comparison libpurple/protocols/jabber/jabber.c @ 25587:3b674151cd60

*** Plucked rev 4831edb9 (darkrain42@pidgin.im): Don't call jabber_parser_close_stream in jabber_close, it papers over a real issue.
author Paul Aurich <paul@darkrain42.org>
date Wed, 29 Apr 2009 21:01:05 +0000
parents f424f26dd329
children b9a90f34b780
comparison
equal deleted inserted replaced
25586:f424f26dd329 25587:3b674151cd60
1321 js->unregistration_user_data = user_data; 1321 js->unregistration_user_data = user_data;
1322 1322
1323 jabber_unregister_account_cb(js); 1323 jabber_unregister_account_cb(js);
1324 } 1324 }
1325 1325
1326 /* TODO: As Will pointed out in IRC, after being notified by the core to
1327 * shutdown, we should async. wait for the server to send us the stream
1328 * termination before destorying everything. That seems like it would require
1329 * changing the semantics of prpl->close(), so it's a good idea for 3.0.0.
1330 */
1326 void jabber_close(PurpleConnection *gc) 1331 void jabber_close(PurpleConnection *gc)
1327 { 1332 {
1328 JabberStream *js = gc->proto_data; 1333 JabberStream *js = gc->proto_data;
1329 1334
1330 /* Don't perform any actions on the ssl connection 1335 /* Don't perform any actions on the ssl connection
1331 * if we were forcibly disconnected because it will crash 1336 * if we were forcibly disconnected because it will crash
1332 * on some SSL backends. 1337 * on some SSL backends.
1333 */ 1338 */
1334 if (!gc->disconnect_timeout) 1339 if (!gc->disconnect_timeout)
1335 jabber_send_raw(js, "</stream:stream>", -1); 1340 jabber_send_raw(js, "</stream:stream>", -1);
1336
1337 if (!purple_account_get_current_error(purple_connection_get_account(gc))) {
1338 /*
1339 * The common case is user-triggered, so we never receive a
1340 * </stream:stream> from the server when disconnecting, so silence the
1341 * parser's warnings. On errors, though, the server terminated the
1342 * connection, so we should have received a real </stream:stream>.
1343 */
1344 jabber_parser_close_stream(js);
1345 }
1346 1341
1347 if (js->srv_query_data) 1342 if (js->srv_query_data)
1348 purple_srv_cancel(js->srv_query_data); 1343 purple_srv_cancel(js->srv_query_data);
1349 1344
1350 if(js->gsc) { 1345 if(js->gsc) {