Philipp Hörist pushed to branch master at gajim / gajim

Commits:
b93098a3 by Philipp Hörist at 2017-09-17T14:02:01+02:00
Dont use Resolver when using a proxy

This leaks the DNS request

- - - - -


1 changed file:

- gajim/common/connection.py


Changes:

=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -1083,7 +1083,8 @@ class Connection(CommonConnection, ConnectionHandlers):
         self._hosts = [ {'host': h, 'port': p, 'ssl_port': ssl_p, 'prio': 10,
                 'weight': 10} ]
         self._hostname = hostname
-        if use_srv:
+
+        if use_srv and self._proxy is None:
             # add request for srv query to the resolve, on result '_on_resolve'
             # will be called
             app.resolver.resolve('_xmpp-client._tcp.' + helpers.idn_to_ascii(
@@ -1823,9 +1824,10 @@ class Connection(CommonConnection, ConnectionHandlers):
 
         self.sm.resuming = False # back to previous state
         # Discover Stun server(s)
-        hostname = app.config.get_per('accounts', self.name, 'hostname')
-        app.resolver.resolve('_stun._udp.' + helpers.idn_to_ascii(hostname),
-                self._on_stun_resolved)
+        if self._proxy is None:
+            hostname = app.config.get_per('accounts', self.name, 'hostname')
+            app.resolver.resolve('_stun._udp.' + 
helpers.idn_to_ascii(hostname),
+                    self._on_stun_resolved)
 
     def _on_stun_resolved(self, host, result_array):
         if len(result_array) != 0:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/b93098a3792253b277562bf7bceaa8c8ced0a149

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/b93098a3792253b277562bf7bceaa8c8ced0a149
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to