Mercurial > pidgin
diff src/protocols/jabber/si.c @ 14113:8ca0e500da4c
[gaim-migrate @ 16747]
Jabber is done. Also, I have a feeling JabberSIXfer->streamhosts is
leaking, if anyone wants to fix it. Wink wink. Nudge Nudge.
Karate chop.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 14 Aug 2006 07:18:58 +0000 |
parents | 7a205b430d19 |
children |
line wrap: on
line diff
--- a/src/protocols/jabber/si.c Mon Aug 14 07:00:26 2006 +0000 +++ b/src/protocols/jabber/si.c Mon Aug 14 07:18:58 2006 +0000 @@ -46,6 +46,8 @@ typedef struct _JabberSIXfer { JabberStream *js; + GaimProxyConnectInfo *connect_info; + gboolean accepted; char *stream_id; @@ -88,7 +90,8 @@ static void jabber_si_bytestreams_attempt_connect(GaimXfer *xfer); -static void jabber_si_bytestreams_connect_cb(gpointer data, gint source) +static void +jabber_si_bytestreams_connect_cb(gpointer data, gint source, const gchar *error_message) { GaimXfer *xfer = data; JabberSIXfer *jsx = xfer->data; @@ -97,6 +100,7 @@ struct bytestreams_streamhost *streamhost = jsx->streamhosts->data; gaim_proxy_info_destroy(jsx->gpi); + jsx->connect_info = NULL; if(source < 0) { jsx->streamhosts = g_list_remove(jsx->streamhosts, streamhost); @@ -167,8 +171,18 @@ for(i=0; i<20; i++, p+=2) snprintf(p, 3, "%02x", hashval[i]); - gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, jabber_si_bytestreams_connect_cb, xfer); + jsx->connect_info = gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, + jabber_si_bytestreams_connect_cb, xfer); g_free(dstaddr); + + if (jsx->connect_info == NULL) + { + jsx->streamhosts = g_list_remove(jsx->streamhosts, streamhost); + g_free(streamhost->jid); + g_free(streamhost->host); + g_free(streamhost); + jabber_si_bytestreams_attempt_connect(xfer); + } } void jabber_bytestreams_parse(JabberStream *js, xmlnode *packet) @@ -682,6 +696,9 @@ js->file_transfers = g_list_remove(js->file_transfers, xfer); + if (jsx->connect_info != NULL) + gaim_proxy_connect_cancel(jsx->connect_info); + g_free(jsx->stream_id); g_free(jsx->iq_id); /* XXX: free other stuff */