X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.cpp;h=8f5758161d8d3425610793819f1f216234c1e741;hp=5ef25571e7e1b24a8bd947a45a903d9547a8b28f;hb=9b8923e3625b5634163b5c164df8fa6a3760f660;hpb=307cafe026abea9badd8400b8fd594738f0160fe diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 5ef25571..8f575816 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -40,6 +40,7 @@ CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session) _lastPingTime(0), _pingCount(0), + _sendPings(false), _requestedUserModes('-') { _autoReconnectTimer.setSingleShot(true); @@ -446,6 +447,8 @@ void CoreNetwork::socketInitialized() emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort()); + enablePingTimeout(); + // TokenBucket to avoid sending too much at once _messageDelay = 2200; // this seems to be a safe value (2.2 seconds delay) _burstSize = 5; @@ -551,7 +554,7 @@ void CoreNetwork::networkInitialized() sendPerform(); - enablePingTimeout(); + _sendPings = true; if (networkConfig()->autoWhoEnabled()) { _autoWhoCycleTimer.start(); @@ -795,7 +798,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 +820,7 @@ void CoreNetwork::enablePingTimeout(bool enable) void CoreNetwork::disablePingTimeout() { _pingTimer.stop(); + _sendPings = false; resetPingTimeout(); }