X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.cpp;h=18f27842a19427b3ee44966bdcee32125849bc8a;hp=3fd0a1a70431242c5f8c5b998ad657642ef87c53;hb=96fe7e7137010c2df3480a8ea774ccbc7dfc88fc;hpb=bb6f47baf3c9fe605db67de9ff6ca5b3f50d02e3 diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 3fd0a1a7..18f27842 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -18,6 +18,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ +#include + #include "corenetwork.h" #include "core.h" @@ -184,8 +186,11 @@ void CoreNetwork::connectToIrc(bool reconnecting) enablePingTimeout(); + // 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. + QHostInfo::fromName(server.host); + #ifdef HAVE_SSL - socket.setProtocol((QSsl::SslProtocol)server.sslVersion); if (server.useSsl) { CoreIdentity *identity = identityPtr(); if (identity) { @@ -265,11 +270,14 @@ void CoreNetwork::putCmd(const QString &cmd, const QList ¶ms, co msg += ":" + prefix + " "; msg += cmd.toUpper().toAscii(); - for (int i = 0; i < params.size() - 1; i++) { - msg += " " + params[i]; + for (int i = 0; i < params.size(); i++) { + msg += " "; + + if (i == params.size() - 1 && (params[i].contains(' ') || (!params[i].isEmpty() && params[i][0] == ':'))) + msg += ":"; + + msg += params[i]; } - if (!params.isEmpty()) - msg += " :" + params.last(); putRawLine(msg); }