comparison libpurple/protocols/jabber/bosh.c @ 25992:c3c2e8b64539

Close a small race with disconnecting while establishing a connection and a potential invalid use of a fd.
author Paul Aurich <paul@darkrain42.org>
date Sun, 15 Mar 2009 05:13:41 +0000
parents 71835e00c0fc
children a94b28023bf6
comparison
equal deleted inserted replaced
25991:71835e00c0fc 25992:c3c2e8b64539
135 if (conn->ie_handle) 135 if (conn->ie_handle)
136 purple_input_remove(conn->ie_handle); 136 purple_input_remove(conn->ie_handle);
137 if (conn->fd >= 0) 137 if (conn->fd >= 0)
138 close(conn->fd); 138 close(conn->fd);
139 139
140 purple_proxy_connect_cancel_with_handle(conn);
141
140 g_free(conn); 142 g_free(conn);
141 } 143 }
142 144
143 PurpleBOSHConnection* 145 PurpleBOSHConnection*
144 jabber_bosh_connection_init(JabberStream *js, const char *url) 146 jabber_bosh_connection_init(JabberStream *js, const char *url)
523 /* 525 /*
524 * Well, then. Fine! I never liked you anyway, server! I was cheating on you 526 * Well, then. Fine! I never liked you anyway, server! I was cheating on you
525 * with AIM! 527 * with AIM!
526 */ 528 */
527 conn->ready = FALSE; 529 conn->ready = FALSE;
530 conn->fd = -1;
528 531
529 if (conn->bosh->pipelining) 532 if (conn->bosh->pipelining)
530 /* Hmmmm, fall back to multiple connections */ 533 /* Hmmmm, fall back to multiple connections */
531 conn->bosh->pipelining = FALSE; 534 conn->bosh->pipelining = FALSE;
532 535