# HG changeset patch # User Paul Aurich # Date 1254175914 0 # Node ID 9206aabf0251e7afc0e6454f26b411fa0bdb5094 # Parent 67a97fca157cf5678e114696ba94077707998fcb jabber: Don't crash when disconnecting if there's been no response from the server. PurpleBOSHConnection.sid is only set after we've received a resposne from the server, so if we try to send a 'terminate' before we have a response, it will crash on Win32 (NULL printf), plus it's wrong anyway. diff -r 67a97fca157c -r 9206aabf0251 libpurple/protocols/jabber/bosh.c --- a/libpurple/protocols/jabber/bosh.c Mon Sep 28 18:11:28 2009 +0000 +++ b/libpurple/protocols/jabber/bosh.c Mon Sep 28 22:11:54 2009 +0000 @@ -401,7 +401,8 @@ void jabber_bosh_connection_close(PurpleBOSHConnection *conn) { - jabber_bosh_connection_send(conn, PACKET_TERMINATE, NULL); + if (conn->state == BOSH_CONN_ONLINE) + jabber_bosh_connection_send(conn, PACKET_TERMINATE, NULL); } static gboolean jabber_bosh_connection_error_check(PurpleBOSHConnection *conn, xmlnode *node) {