changeset 5898:5baeb89ee2d4

[gaim-migrate @ 6330] This should fix the XFR problem for good. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 15 Jun 2003 19:57:23 +0000
parents e3733414ca08
children 349204c9a709
files src/protocols/msn/servconn.c src/protocols/msn/session.h
diffstat 2 files changed, 10 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/servconn.c	Sun Jun 15 19:23:59 2003 +0000
+++ b/src/protocols/msn/servconn.c	Sun Jun 15 19:57:23 2003 +0000
@@ -61,12 +61,9 @@
 	size_t param_count = 0;
 	char *command, *param_start;
 	char **params = NULL;
-	MsnServConn *old_notification_conn;
 
 	command = str;
 
-	old_notification_conn = session->notification_conn;
-
 	/**
 	 * See how many spaces we have in this.
 	 */
@@ -102,18 +99,8 @@
 	if (params != NULL)
 		g_strfreev(params);
 
-	/*
-	 * We're checking here if the old notification server was replaced
-	 * with a new one, and if the current servconn here is the old
-	 * notification server. If so, we're going to have a bit of trouble
-	 * in the upcoming loop, as servconn will be a freed variable, so
-	 * we'll just return early.
-	 */
-	if (servconn == old_notification_conn &&
-		old_notification_conn != session->notification_conn) {
-
+	if (g_list_find(session->servconns, servconn) == NULL)
 		return result;
-	}
 
 	/* Process all queued messages that are waiting on this command. */
 	for (l = servconn->msg_queue; l != NULL; l = l_next) {
@@ -203,6 +190,8 @@
 	servconn->msg_types = g_hash_table_new_full(g_str_hash, g_str_equal,
 												g_free, NULL);
 
+	session->servconns = g_list_append(session->servconns, servconn);
+
 	return servconn;
 }
 
@@ -256,8 +245,14 @@
 void
 msn_servconn_destroy(MsnServConn *servconn)
 {
+	MsnSession *session;
+
 	g_return_if_fail(servconn != NULL);
 
+	session = servconn->session;
+
+	session->servconns = g_list_remove(session->servconns, servconn);
+
 	if (servconn->connected)
 		msn_servconn_disconnect(servconn);
 
--- a/src/protocols/msn/session.h	Sun Jun 15 19:23:59 2003 +0000
+++ b/src/protocols/msn/session.h	Sun Jun 15 19:57:23 2003 +0000
@@ -47,6 +47,7 @@
 	MsnUsers *users;
 	MsnGroups *groups;
 
+	GList *servconns;
 	GList *switches;
 
 	struct