Fix round-robin for networks that support it
authorManuel Nickschas <sputnick@quassel-irc.org>
Fri, 14 Mar 2014 20:13:09 +0000 (21:13 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 14 Mar 2014 20:13:09 +0000 (21:13 +0100)
commit96fe7e7137010c2df3480a8ea774ccbc7dfc88fc
tree43cc89cd3af8596f8c6a54bc7018f67478013b8a
parent155eda45e862f42a0b9444d615002deda461328d
Fix round-robin for networks that support it

Some IRC networks perform round-robin by supplying a list of IP addresses
in their DNS records. However, Qt a) always uses the first address of that
list, and b) caches DNS records for a minute. This results that users who
connect at a roughly similar time (like at core startup) will all pick the
same IP for a given round-robin network address.

We now force Qt (simply by calling QHostInfo::fromName()) to perform a fresh
lookup every time it connects to an IRC network, which solves this problem.
However, this will not help you if your OS uses a system DNS cache that does
not reshuffle the list of IPs for repeated lookups.
src/core/corenetwork.cpp