core: connectToIrc: Add clarifying comment on DNS lookups
authorAlbert S <mail@quitesimple.org>
Mon, 21 Aug 2017 19:35:41 +0000 (21:35 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 4 Apr 2018 21:14:04 +0000 (23:14 +0200)
Closes GH-298.

(cherry picked from commit a6c3d4252d760a6de70cb000cc3d6ee34a36eb31)

src/core/corenetwork.cpp

index 53960b6..ca75c2e 100644 (file)
@@ -219,8 +219,10 @@ void CoreNetwork::connectToIrc(bool reconnecting)
     // Qt caches DNS entries for a minute, resulting in round-robin (e.g. for chat.freenode.net) not working if several users
     // connect at a similar time. QHostInfo::fromName(), however, always performs a fresh lookup, overwriting the cache entry.
     if (! server.useProxy) {
-               QHostInfo::fromName(server.host);
-       }
+        //Avoid hostname lookups when a proxy is specified. The lookups won't use the proxy and may therefore leak the DNS
+        //hostname of the server. Qt's DNS cache also isn't used by the proxy so we don't need to refresh the entry.
+        QHostInfo::fromName(server.host);
+    }
 #ifdef HAVE_SSL
     if (server.useSsl) {
         CoreIdentity *identity = identityPtr();