Mercurial > pidgin
comparison src/protocols/msn/servconn.c @ 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 |
comparison
equal
deleted
inserted
replaced
5897:e3733414ca08 | 5898:5baeb89ee2d4 |
---|---|
59 GSList *l, *l_next = NULL; | 59 GSList *l, *l_next = NULL; |
60 gboolean result; | 60 gboolean result; |
61 size_t param_count = 0; | 61 size_t param_count = 0; |
62 char *command, *param_start; | 62 char *command, *param_start; |
63 char **params = NULL; | 63 char **params = NULL; |
64 MsnServConn *old_notification_conn; | |
65 | 64 |
66 command = str; | 65 command = str; |
67 | |
68 old_notification_conn = session->notification_conn; | |
69 | 66 |
70 /** | 67 /** |
71 * See how many spaces we have in this. | 68 * See how many spaces we have in this. |
72 */ | 69 */ |
73 param_start = strchr(command, ' '); | 70 param_start = strchr(command, ' '); |
100 result = cb(servconn, command, (const char **)params, param_count); | 97 result = cb(servconn, command, (const char **)params, param_count); |
101 | 98 |
102 if (params != NULL) | 99 if (params != NULL) |
103 g_strfreev(params); | 100 g_strfreev(params); |
104 | 101 |
105 /* | 102 if (g_list_find(session->servconns, servconn) == NULL) |
106 * We're checking here if the old notification server was replaced | |
107 * with a new one, and if the current servconn here is the old | |
108 * notification server. If so, we're going to have a bit of trouble | |
109 * in the upcoming loop, as servconn will be a freed variable, so | |
110 * we'll just return early. | |
111 */ | |
112 if (servconn == old_notification_conn && | |
113 old_notification_conn != session->notification_conn) { | |
114 | |
115 return result; | 103 return result; |
116 } | |
117 | 104 |
118 /* Process all queued messages that are waiting on this command. */ | 105 /* Process all queued messages that are waiting on this command. */ |
119 for (l = servconn->msg_queue; l != NULL; l = l_next) { | 106 for (l = servconn->msg_queue; l != NULL; l = l_next) { |
120 MsnQueueEntry *entry = l->data; | 107 MsnQueueEntry *entry = l->data; |
121 MsnMessage *msg; | 108 MsnMessage *msg; |
201 g_free, NULL); | 188 g_free, NULL); |
202 | 189 |
203 servconn->msg_types = g_hash_table_new_full(g_str_hash, g_str_equal, | 190 servconn->msg_types = g_hash_table_new_full(g_str_hash, g_str_equal, |
204 g_free, NULL); | 191 g_free, NULL); |
205 | 192 |
193 session->servconns = g_list_append(session->servconns, servconn); | |
194 | |
206 return servconn; | 195 return servconn; |
207 } | 196 } |
208 | 197 |
209 gboolean | 198 gboolean |
210 msn_servconn_connect(MsnServConn *servconn) | 199 msn_servconn_connect(MsnServConn *servconn) |
254 } | 243 } |
255 | 244 |
256 void | 245 void |
257 msn_servconn_destroy(MsnServConn *servconn) | 246 msn_servconn_destroy(MsnServConn *servconn) |
258 { | 247 { |
259 g_return_if_fail(servconn != NULL); | 248 MsnSession *session; |
249 | |
250 g_return_if_fail(servconn != NULL); | |
251 | |
252 session = servconn->session; | |
253 | |
254 session->servconns = g_list_remove(session->servconns, servconn); | |
260 | 255 |
261 if (servconn->connected) | 256 if (servconn->connected) |
262 msn_servconn_disconnect(servconn); | 257 msn_servconn_disconnect(servconn); |
263 | 258 |
264 if (servconn->server != NULL) | 259 if (servconn->server != NULL) |