comparison libpurple/protocols/jabber/bosh.c @ 28303:9206aabf0251

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.
author Paul Aurich <paul@darkrain42.org>
date Mon, 28 Sep 2009 22:11:54 +0000
parents b357216b7b79
children 931d6906291b
comparison
equal deleted inserted replaced
28302:67a97fca157c 28303:9206aabf0251
399 http_connection_send_request(chosen, packet); 399 http_connection_send_request(chosen, packet);
400 } 400 }
401 401
402 void jabber_bosh_connection_close(PurpleBOSHConnection *conn) 402 void jabber_bosh_connection_close(PurpleBOSHConnection *conn)
403 { 403 {
404 jabber_bosh_connection_send(conn, PACKET_TERMINATE, NULL); 404 if (conn->state == BOSH_CONN_ONLINE)
405 jabber_bosh_connection_send(conn, PACKET_TERMINATE, NULL);
405 } 406 }
406 407
407 static gboolean jabber_bosh_connection_error_check(PurpleBOSHConnection *conn, xmlnode *node) { 408 static gboolean jabber_bosh_connection_error_check(PurpleBOSHConnection *conn, xmlnode *node) {
408 const char *type; 409 const char *type;
409 410