comparison libpurple/protocols/msnp9/servconn.c @ 23526:af2cfc9a42b3

On MSN, cancel the connection process to a server before checking servconn->connected. Otherwise, if the MsnServConn wasn't marked as connected, and the account was disabled, the request would continue on while the MsnServConn was freed.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 13 Jul 2008 01:15:09 +0000
parents 252b96b6a32c
children 91169093449d
comparison
equal deleted inserted replaced
23525:5dafc77b169e 23526:af2cfc9a42b3
249 void 249 void
250 msn_servconn_disconnect(MsnServConn *servconn) 250 msn_servconn_disconnect(MsnServConn *servconn)
251 { 251 {
252 g_return_if_fail(servconn != NULL); 252 g_return_if_fail(servconn != NULL);
253 253
254 if (servconn->connect_data != NULL)
255 {
256 purple_proxy_connect_cancel(servconn->connect_data);
257 servconn->connect_data = NULL;
258 }
259
254 if (!servconn->connected) 260 if (!servconn->connected)
255 { 261 {
256 /* We could not connect. */ 262 /* We could not connect. */
257 if (servconn->disconnect_cb != NULL) 263 if (servconn->disconnect_cb != NULL)
258 servconn->disconnect_cb(servconn); 264 servconn->disconnect_cb(servconn);
265 /* Fake disconnection. */ 271 /* Fake disconnection. */
266 if (servconn->disconnect_cb != NULL) 272 if (servconn->disconnect_cb != NULL)
267 servconn->disconnect_cb(servconn); 273 servconn->disconnect_cb(servconn);
268 274
269 return; 275 return;
270 }
271
272 if (servconn->connect_data != NULL)
273 {
274 purple_proxy_connect_cancel(servconn->connect_data);
275 servconn->connect_data = NULL;
276 } 276 }
277 277
278 if (servconn->inpa > 0) 278 if (servconn->inpa > 0)
279 { 279 {
280 purple_input_remove(servconn->inpa); 280 purple_input_remove(servconn->inpa);