cpw.darkrain42.xmpp.bosh: 1ba44239: Close a small race with disconnecting wh...

paul at darkrain42.org paul at darkrain42.org
Sun Mar 22 23:10:35 EDT 2009


-----------------------------------------------------------------
Revision: 1ba44239367b66d01c23bfbd908a1e068f2a97f8
Ancestor: dc1b19fdc34dbe8f0c00d0ebc118463655c0751d
Author: paul at darkrain42.org
Date: 2009-03-15T05:13:41
Branch: im.pidgin.cpw.darkrain42.xmpp.bosh
URL: http://d.pidgin.im/viewmtn/revision/info/1ba44239367b66d01c23bfbd908a1e068f2a97f8

Modified files:
        libpurple/protocols/jabber/bosh.c

ChangeLog: 

Close a small race with disconnecting while establishing a connection and
a potential invalid use of a fd.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/bosh.c	b6d8819161031596c0f252779a6d01f2450b13ee
+++ libpurple/protocols/jabber/bosh.c	69f3bc20a0763f5beab7cde1f3a6b2d474a911d5
@@ -137,6 +137,8 @@ jabber_bosh_http_connection_destroy(Purp
 	if (conn->fd >= 0)
 		close(conn->fd);
 
+	purple_proxy_connect_cancel_with_handle(conn);
+
 	g_free(conn);
 }
 
@@ -525,6 +527,7 @@ static void http_connection_disconnected
 	 * with AIM!
 	 */
 	conn->ready = FALSE;
+	conn->fd = -1;
 
 	if (conn->bosh->pipelining)
 		/* Hmmmm, fall back to multiple connections */


More information about the Commits mailing list