X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.cpp;h=406f24415df8674a0fd5462d78485cd1b6ff9e43;hb=411cf6cc06dd7f1c393efb52ffa1d213c40393a1;hp=5ef25571e7e1b24a8bd947a45a903d9547a8b28f;hpb=7e921d7a935715886f2cf3398e0b473f9fe71a47;p=quassel.git diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 5ef25571..406f2441 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -40,10 +40,10 @@ CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session) _lastPingTime(0), _pingCount(0), + _sendPings(false), _requestedUserModes('-') { _autoReconnectTimer.setSingleShot(true); - _socketCloseTimer.setSingleShot(true); connect(&_socketCloseTimer, SIGNAL(timeout()), this, SLOT(socketCloseTimeout())); setPingInterval(networkConfig()->pingInterval()); @@ -182,6 +182,8 @@ void CoreNetwork::connectToIrc(bool reconnecting) socket.setProxy(QNetworkProxy::NoProxy); } + enablePingTimeout(); + #ifdef HAVE_SSL socket.setProtocol((QSsl::SslProtocol)server.sslVersion); if (server.useSsl) { @@ -551,7 +553,7 @@ void CoreNetwork::networkInitialized() sendPerform(); - enablePingTimeout(); + _sendPings = true; if (networkConfig()->autoWhoEnabled()) { _autoWhoCycleTimer.start(); @@ -795,7 +797,9 @@ void CoreNetwork::sendPing() else { _lastPingTime = now; _pingCount++; - userInputHandler()->handlePing(BufferInfo(), QString()); + // Don't send pings until the network is initialized + if(_sendPings) + userInputHandler()->handlePing(BufferInfo(), QString()); } } @@ -815,6 +819,7 @@ void CoreNetwork::enablePingTimeout(bool enable) void CoreNetwork::disablePingTimeout() { _pingTimer.stop(); + _sendPings = false; resetPingTimeout(); }