This fixes the problem where Quassel would get stuck while connecting
if the socket is closed by the server but the core is, for whatever
reason, not notified of this. This patch works by enabling the ping
timeout as soon as the connection is open, but not actually sending any
PINGs until the IRC authentication is complete. This will cause the core
to reconnect if at any point it doesn't receive data from the server for
more than the usual ping timeout interval.
Fixes #1249
_lastPingTime(0),
_pingCount(0),
_lastPingTime(0),
_pingCount(0),
_requestedUserModes('-')
{
_autoReconnectTimer.setSingleShot(true);
_requestedUserModes('-')
{
_autoReconnectTimer.setSingleShot(true);
emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort());
emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort());
// TokenBucket to avoid sending too much at once
_messageDelay = 2200; // this seems to be a safe value (2.2 seconds delay)
_burstSize = 5;
// TokenBucket to avoid sending too much at once
_messageDelay = 2200; // this seems to be a safe value (2.2 seconds delay)
_burstSize = 5;
if (networkConfig()->autoWhoEnabled()) {
_autoWhoCycleTimer.start();
if (networkConfig()->autoWhoEnabled()) {
_autoWhoCycleTimer.start();
else {
_lastPingTime = now;
_pingCount++;
else {
_lastPingTime = now;
_pingCount++;
- userInputHandler()->handlePing(BufferInfo(), QString());
+ // Don't send pings until the network is initialized
+ if(_sendPings)
+ userInputHandler()->handlePing(BufferInfo(), QString());
void CoreNetwork::disablePingTimeout()
{
_pingTimer.stop();
void CoreNetwork::disablePingTimeout()
{
_pingTimer.stop();
QTimer _pingTimer;
uint _lastPingTime;
uint _pingCount;
QTimer _pingTimer;
uint _lastPingTime;
uint _pingCount;
QStringList _autoWhoQueue;
QHash<QString, int> _autoWhoPending;
QStringList _autoWhoQueue;
QHash<QString, int> _autoWhoPending;