cpw.malu.xmpp.jingle_ft: 62c7f97c: Cancel the local listener also when "win...

malu at pidgin.im malu at pidgin.im
Wed May 12 11:21:46 EDT 2010


-----------------------------------------------------------------
Revision: 62c7f97c4448079c340761c9bf6b5b261b710c09
Ancestor: 586ff24c6e8ba127506d9b7a0e53c4d82af2eded
Author: malu at pidgin.im
Date: 2010-05-12T15:16:17
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/62c7f97c4448079c340761c9bf6b5b261b710c09

Modified files:
        libpurple/protocols/jabber/jingle/s5b.c

ChangeLog: 

Cancel the local listener also when "winning" negotiation, since the winning
candidate could be a proxy (and the local listner should be stopped).
When using a local direct candidate the connection will already be established, thus
cancelling the local listner is a no-op

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/s5b.c	ec1957a5836fa0af26864fdc70133d5e33216fe5
+++ libpurple/protocols/jabber/jingle/s5b.c	f0785580714037a8410689c6b841f999b5c44098
@@ -329,6 +329,12 @@ jingle_s5b_finalize (GObject *s5b)
 
 	if (priv->listen_data)
 		purple_network_listen_cancel(priv->listen_data);
+
+	/* stop listening */
+	if (priv->socks5_listen_data) {
+		jabber_socks5_listen_cancel(priv->socks5_listen_data);
+		jabber_socks5_listen_data_free(priv->socks5_listen_data);
+	}
 	
 	/* remove port mapping */
 	if (priv->fd >= 0) {
@@ -570,6 +576,10 @@ jingle_s5b_take_command(JingleS5B *s5b)
 	}
 
 	if (s5b->priv->socks5_listen_data) {
+		/* even if we got a "candidate-used" from the other end, and "won"
+		 candidate election, we should still stop the listner if it's still
+		 listening, since the selected candidate might be a proxy */
+		jabber_socks5_listen_cancel(s5b->priv->socks5_listen_data);
 		jabber_socks5_listen_data_free(s5b->priv->socks5_listen_data);
 		s5b->priv->socks5_listen_data = NULL;
 	}


More information about the Commits mailing list