Adding some debug output to NetworkConnection for the next time we run into the endless
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 29 Mar 2008 22:17:57 +0000 (22:17 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 29 Mar 2008 22:17:57 +0000 (22:17 +0000)
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
src/core/networkconnection.h

index 43749bc..a461d26 100644 (file)
@@ -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);
   }
 }
index 1a7aafa..83ea6f3 100644 (file)
@@ -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);