changeset 5930:03f1d6cd784c

[gaim-migrate @ 6370] Added debug statements (probably temporary), and fixed a small disconnect bug. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 20 Jun 2003 05:41:39 +0000
parents b85e88d3fa5f
children 8b5dd7117f56
files src/account.c src/connection.c
diffstat 2 files changed, 23 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/account.c	Fri Jun 20 05:40:49 2003 +0000
+++ b/src/account.c	Fri Jun 20 05:41:39 2003 +0000
@@ -143,9 +143,15 @@
 {
 	g_return_if_fail(account != NULL);
 
+	gaim_debug(GAIM_DEBUG_INFO, "account",
+			   "Destroying account %p\n", account);
+
 	if (account->gc != NULL)
 		gaim_connection_destroy(account->gc);
 
+	gaim_debug(GAIM_DEBUG_INFO, "account",
+			   "Continuing to destroy account %p\n", account);
+
 	if (account->username    != NULL) g_free(account->username);
 	if (account->alias       != NULL) g_free(account->alias);
 	if (account->password    != NULL) g_free(account->password);
@@ -168,6 +174,9 @@
 
 	gc = gaim_connection_new(account);
 
+	gaim_debug(GAIM_DEBUG_INFO, "account",
+			   "Connecting to account %p. gc = %p\n", account, gc);
+
 	gaim_connection_connect(gc);
 
 	return gc;
@@ -181,6 +190,9 @@
 	g_return_if_fail(account != NULL);
 	g_return_if_fail(gaim_account_is_connected(account));
 
+	gaim_debug(GAIM_DEBUG_INFO, "account",
+			   "Disconnecting account %p\n", account);
+
 	gc = gaim_account_get_connection(account);
 
 	gaim_account_set_connection(account, NULL);
@@ -487,7 +499,7 @@
 	g_return_val_if_fail(account != NULL, FALSE);
 
 	return (account->gc != NULL &&
-			gaim_connection_get_state(account->gc) == GAIM_CONNECTED);
+			gaim_connection_get_state(account->gc) != GAIM_DISCONNECTED);
 }
 
 const char *
--- a/src/connection.c	Fri Jun 20 05:40:49 2003 +0000
+++ b/src/connection.c	Fri Jun 20 05:41:39 2003 +0000
@@ -66,6 +66,9 @@
 		return;
 	}
 
+	gaim_debug(GAIM_DEBUG_INFO, "connection",
+			   "Destroying connection %p\n", gc);
+
 	account = gaim_connection_get_account(gc);
 	gaim_account_set_connection(account, NULL);
 
@@ -90,6 +93,9 @@
 
 	g_return_if_fail(gc != NULL);
 
+	gaim_debug(GAIM_DEBUG_INFO, "connection",
+			   "Connecting. gc = %p\n", gc);
+
 	ops = gaim_get_connection_ui_ops();
 
 	prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
@@ -100,7 +106,7 @@
 		!(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL) &&
 		gaim_account_get_password(account) == NULL) {
 
-		gaim_debug(GAIM_DEBUG_INFO, "connection", "Requestin password\n");
+		gaim_debug(GAIM_DEBUG_INFO, "connection", "Requesting password\n");
 
 		if (ops != NULL && ops->request_pass != NULL)
 			ops->request_pass(gc);
@@ -132,6 +138,9 @@
 		return;
 	}
 
+	gaim_debug(GAIM_DEBUG_INFO, "connection",
+			   "Disconnecting connection %p\n", gc);
+
 	if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) {
 		if (gaim_connection_get_state(gc) != GAIM_CONNECTING)
 			gaim_blist_remove_account(gaim_connection_get_account(gc));