pidgin: e9411486: xmpp: Don't advertise our IPs as availab...

datallah at pidgin.im datallah at pidgin.im
Mon May 2 22:31:39 EDT 2011


----------------------------------------------------------------------
Revision: e94114863f0a88734486a256f21a13697c6711a6
Parent:   6aa82282e6ca33634357e91c18d470a5a01d52ba
Author:   datallah at pidgin.im
Date:     05/02/11 22:26:35
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e94114863f0a88734486a256f21a13697c6711a6

Changelog: 

xmpp: Don't advertise our IPs as available streamhosts when using a TOR proxy.

If we weren't string-frozen, I'd use a new separate account option for this.

Refs #13928

Changes against parent 6aa82282e6ca33634357e91c18d470a5a01d52ba

  patched  libpurple/protocols/jabber/si.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/si.c	1ee7a2348a129aea94739f7d0f5f2fefd44cdd78
+++ libpurple/protocols/jabber/si.c	29ae5a130fa7c0918da00beebd2b1ef118f71c28
@@ -965,15 +965,23 @@ jabber_si_xfer_bytestreams_send_init(Pur
 jabber_si_xfer_bytestreams_send_init(PurpleXfer *xfer)
 {
 	JabberSIXfer *jsx;
+	PurpleProxyType proxy_type;
 
 	purple_xfer_ref(xfer);
 
 	jsx = xfer->data;
 
-	/* TODO: Should there be an option to not use the local host as a ft proxy?
-	 *       (to prevent revealing IP address, etc.) */
-	jsx->listen_data = purple_network_listen_range(0, 0, SOCK_STREAM,
+	/* TODO: This should probably be done with an account option instead of
+	 *       piggy-backing on the TOR proxy type. */
+	proxy_type = purple_proxy_info_get_type(
+		purple_proxy_get_setup(purple_connection_get_account(jsx->js->gc)));
+	if (proxy_type == PURPLE_PROXY_TOR) {
+		purple_debug_info("jabber", "Skipping attempting local streamhost.\n");
+		jsx->listen_data = NULL;
+	} else
+		jsx->listen_data = purple_network_listen_range(0, 0, SOCK_STREAM,
 				jabber_si_xfer_bytestreams_listen_cb, xfer);
+
 	if (jsx->listen_data == NULL) {
 		/* We couldn't open a local port.  Perhaps we can use a proxy. */
 		jabber_si_xfer_bytestreams_listen_cb(-1, xfer);


More information about the Commits mailing list