pidgin: 4831edb9: Don't call jabber_parser_close_stream in...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Tue Apr 28 17:21:44 EDT 2009
-----------------------------------------------------------------
Revision: 4831edb99cb3b9420b5fc9cee492184c163b291b
Ancestor: 19a942d3ffab6aa6d2a63d02f08d06b2a812ff13
Author: darkrain42 at pidgin.im
Date: 2009-04-27T16:57:26
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/4831edb99cb3b9420b5fc9cee492184c163b291b
Modified files:
libpurple/protocols/jabber/jabber.c
ChangeLog:
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 </stream:stream> (or a short-ish timeout) before closing
the connection. That's both non-trivial and probably requires a major bump.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c e16e070383c12a60377577b3ea3ad00cdeb911d7
+++ libpurple/protocols/jabber/jabber.c bb3e03a47f49fa59908cd22ee0b04ef2dab9a4c0
@@ -1350,6 +1350,11 @@ void jabber_unregister_account(PurpleAcc
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 @@ void jabber_close(PurpleConnection *gc)
if (!gc->disconnect_timeout)
jabber_send_raw(js, "</stream:stream>", -1);
- if (!purple_account_get_current_error(purple_connection_get_account(gc))) {
- /*
- * The common case is user-triggered, so we never receive a
- * </stream:stream> 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 </stream:stream>.
- */
- jabber_parser_close_stream(js);
- }
-
if (js->srv_query_data)
purple_srv_cancel(js->srv_query_data);
More information about the Commits
mailing list