From 90ee8b5c90923a3d4a48fc5493ca999e9d0d6a97 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sat, 29 Mar 2008 22:17:57 +0000 Subject: [PATCH] Adding some debug output to NetworkConnection for the next time we run into the endless message loop... :( Starting core with --sputdev will print a warning whenever a message is received twice from the socket.. That will make crystal-clear if the bug is in our handler or in QTcpSocket. NOTE: Starting core with --sputdev currently has no other side-effects, don't try this with the client though :) --- src/core/networkconnection.cpp | 5 +++++ src/core/networkconnection.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/core/networkconnection.cpp b/src/core/networkconnection.cpp index 43749bcd..a461d262 100644 --- a/src/core/networkconnection.cpp +++ b/src/core/networkconnection.cpp @@ -280,6 +280,11 @@ void NetworkConnection::disconnectFromIrc(bool requested) { void NetworkConnection::socketHasData() { while(socket.canReadLine()) { QByteArray s = socket.readLine().trimmed(); + // FIXME debug + if(Global::SPUTDEV && s == lastMsgReceived) { + qWarning() << "NetworkConnection::socketHasData(): Message repeated! -> loop?"; + } + lastMsgReceived = s; ircServerHandler()->handleServerMsg(s); } } diff --git a/src/core/networkconnection.h b/src/core/networkconnection.h index 1a7aafaa..83ea6f31 100644 --- a/src/core/networkconnection.h +++ b/src/core/networkconnection.h @@ -170,6 +170,8 @@ private: bool _previousConnectionAttemptFailed; int _lastUsedServerlistIndex; + QByteArray lastMsgReceived; // FIXME debug + class ParseError : public Exception { public: ParseError(QString cmd, QString prefix, QStringList params); -- 2.20.1