comparison libpurple/connection.c @ 20119:ec3471ab96d6

Check in purple_connection_error_reason that purple_connection_reason_is_fatal == wants_to_die, and log a debug warning if not.
author Will Thompson <will.thompson@collabora.co.uk>
date Wed, 19 Sep 2007 15:16:32 +0000
parents a68d51d60177
children e78b4aa457a7
comparison
equal deleted inserted replaced
20118:c26b7aff4e96 20119:ec3471ab96d6
495 purple_connection_error_reason (PurpleConnection *gc, 495 purple_connection_error_reason (PurpleConnection *gc,
496 PurpleDisconnectReason reason, 496 PurpleDisconnectReason reason,
497 const char *description) 497 const char *description)
498 { 498 {
499 PurpleConnectionUiOps *ops; 499 PurpleConnectionUiOps *ops;
500 gboolean fatal;
500 501
501 g_return_if_fail(gc != NULL); 502 g_return_if_fail(gc != NULL);
502 503
503 if (description == NULL) { 504 if (description == NULL) {
504 purple_debug_error("connection", "purple_connection_error_reason: check `description != NULL' failed\n"); 505 purple_debug_error("connection", "purple_connection_error_reason: check `description != NULL' failed\n");
505 description = _("Unknown error"); 506 description = _("Unknown error");
506 } 507 }
507 508
508 g_assert (reason < PURPLE_NUM_REASONS); 509 g_assert (reason < PURPLE_NUM_REASONS);
510
511 /* This should probably be removed at some point */
512 fatal = purple_connection_reason_is_fatal (reason);
513 if (fatal != gc->wants_to_die)
514 purple_debug_warning ("connection",
515 "reason %u is %sfatal but wants_to_die is %u",
516 reason, (fatal ? "" : "not "), gc->wants_to_die);
509 517
510 /* If we've already got one error, we don't need any more */ 518 /* If we've already got one error, we don't need any more */
511 if (gc->disconnect_timeout) 519 if (gc->disconnect_timeout)
512 return; 520 return;
513 521