changeset 6029:38999b6b1838

[gaim-migrate @ 6479] This fixes many random problems with oscar not being able to sign on or getting kicked offline. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 05 Jul 2003 07:36:09 +0000
parents 98407c5019e9
children 54c37db13279
files src/connection.c src/protocols/oscar/oscar.c
diffstat 2 files changed, 22 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/connection.c	Sat Jul 05 07:33:48 2003 +0000
+++ b/src/connection.c	Sat Jul 05 07:36:09 2003 +0000
@@ -172,6 +172,16 @@
 	gaim_connection_destroy(gc);
 }
 
+gboolean
+gaim_connection_disconnect_cb(gpointer data)
+{
+	GaimConnection *gc = data;
+
+	gaim_connection_disconnect(gc);
+
+	return FALSE;
+}
+
 /*
  * d:)->-< 
  *
@@ -361,7 +371,7 @@
 	if (ops != NULL && ops->disconnected != NULL)
 		ops->disconnected(gc, text);
 
-	gaim_connection_disconnect(gc);
+	g_timeout_add(0, gaim_connection_disconnect_cb, gc);
 }
 
 void
--- a/src/protocols/oscar/oscar.c	Sat Jul 05 07:33:48 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Jul 05 07:36:09 2003 +0000
@@ -516,8 +516,10 @@
 		} else {
 			if (aim_get_command(od->sess, conn) >= 0) {
 				aim_rxdispatch(od->sess);
-				if (od->killme)
-					gaim_connection_destroy(gc);
+				if (od->killme) {
+					gaim_debug(GAIM_DEBUG_ERROR, "oscar", "Waiting to be destroyed\n");
+					return;
+				}
 			} else {
 				if ((conn->type == AIM_CONN_TYPE_BOS) ||
 					   !(aim_getconn_type(od->sess, AIM_CONN_TYPE_BOS))) {
@@ -1028,16 +1030,15 @@
 }
 
 static int gaim_parse_auth_resp(aim_session_t *sess, aim_frame_t *fr, ...) {
+	GaimConnection *gc = sess->aux_data;
+	struct oscar_data *od = gc->proto_data;
+	GaimAccount *account = gc->account;
+	aim_conn_t *bosconn;
+	char *host; int port;
+	int i, rc;
 	va_list ap;
 	struct aim_authresp_info *info;
-	int i, rc;
-	char *host; int port;
-	GaimAccount *account;
-	aim_conn_t *bosconn;
-
-	GaimConnection *gc = sess->aux_data;
-        struct oscar_data *od = gc->proto_data;
-	account = gc->account;
+
 	port = gaim_account_get_int(account, "port", FAIM_LOGIN_PORT);
 
 	va_start(ap, fr);