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:56:23 +0000 (21:56 +0100)
commit0f90ddac15ade13e38892011fc324b7a3cbb4111
tree34c1efdf3bb2e6ab4200b10c5e23795a28d39b93
parent39322ca33d77a7378bbac92ec20698e3e9b6a18e
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