# HG changeset patch # User Paul Aurich # Date 1240851446 0 # Node ID baa3867f2281e7528e4c86681699f99fb3b4cb96 # Parent 4b8eb280d946ec4cef55f8d53a776dec7e9326e0 Don't call jabber_parser_close_stream in jabber_close, it papers over a real issue. As the comment notes and Will pointed out, we should be waiting for the server to send us a (or a short-ish timeout) before closing the connection. That's both non-trivial and probably requires a major bump. diff -r 4b8eb280d946 -r baa3867f2281 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Mon Apr 27 06:26:28 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Mon Apr 27 16:57:26 2009 +0000 @@ -1350,6 +1350,11 @@ jabber_unregister_account_cb(js); } +/* TODO: As Will pointed out in IRC, after being notified by the core to + * shutdown, we should async. wait for the server to send us the stream + * termination before destorying everything. That seems like it would require + * changing the semantics of prpl->close(), so it's a good idea for 3.0.0. + */ void jabber_close(PurpleConnection *gc) { JabberStream *js = gc->proto_data; @@ -1364,16 +1369,6 @@ if (!gc->disconnect_timeout) jabber_send_raw(js, "", -1); - if (!purple_account_get_current_error(purple_connection_get_account(gc))) { - /* - * The common case is user-triggered, so we never receive a - * from the server when disconnecting, so silence the - * parser's warnings. On errors, though, the server terminated the - * connection, so we should have received a real . - */ - jabber_parser_close_stream(js); - } - if (js->srv_query_data) purple_srv_cancel(js->srv_query_data);