From 7ba9bc4b049f6b086e74776257ef85a573b979f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20H=C3=B6rist?= <philipp@hoerist.com>
Date: Sat, 16 Mar 2019 13:22:05 +0100
Subject: [PATCH] Dont leak DNS query if we connect via proxy

Fixes #9573
---
 gajim/common/connection.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gajim/common/connection.py b/gajim/common/connection.py
index 85bb257942..2ace02d43e 100644
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -905,10 +905,6 @@ class Connection(CommonConnection, ConnectionHandlers):
         ]
         self._hostname = hostname
 
-        if h:
-            app.resolver.resolve('_xmppconnect.' + helpers.idn_to_ascii(h),
-                                 self._on_resolve_txt, type_='txt')
-
         if use_srv and self._proxy is None:
             self._srv_hosts = []
 
@@ -918,6 +914,9 @@ class Connection(CommonConnection, ConnectionHandlers):
             for service in services:
                 record_name = '_' + service + '._tcp.' + helpers.idn_to_ascii(h)
                 app.resolver.resolve(record_name, self._on_resolve_srv)
+
+            app.resolver.resolve('_xmppconnect.' + helpers.idn_to_ascii(h),
+                                 self._on_resolve_txt, type_='txt')
         else:
             self._connect_to_next_host()
 
-- 
GitLab