Output the chosen protocol type on connect
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 15 Feb 2014 20:49:59 +0000 (21:49 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 15 Feb 2014 21:01:02 +0000 (22:01 +0100)
Just some debug messages showing which protocol has been selected.

src/client/clientauthhandler.cpp
src/common/protocols/datastream/datastreampeer.h
src/common/protocols/legacy/legacypeer.h
src/common/remotepeer.h
src/core/coreauthhandler.cpp

index 6040798..15efef3 100644 (file)
@@ -251,6 +251,8 @@ void ClientAuthHandler::onProtocolVersionMismatch(int actual, int expected)
 
 void ClientAuthHandler::setPeer(RemotePeer *peer)
 {
 
 void ClientAuthHandler::setPeer(RemotePeer *peer)
 {
+    qDebug().nospace() << "Using " << qPrintable(peer->protocolName()) << "...";
+
     _peer = peer;
     connect(_peer, SIGNAL(transferProgress(int,int)), SIGNAL(transferProgress(int,int)));
 
     _peer = peer;
     connect(_peer, SIGNAL(transferProgress(int,int)), SIGNAL(transferProgress(int,int)));
 
index 6f8a66c..c733fda 100644 (file)
@@ -44,6 +44,7 @@ public:
     DataStreamPeer(AuthHandler *authHandler, QTcpSocket *socket, quint16 features, QObject *parent = 0);
 
     Protocol::Type protocol() const { return Protocol::DataStreamProtocol; }
     DataStreamPeer(AuthHandler *authHandler, QTcpSocket *socket, quint16 features, QObject *parent = 0);
 
     Protocol::Type protocol() const { return Protocol::DataStreamProtocol; }
+    QString protocolName() const { return "the DataStream protocol"; }
 
     static quint16 supportedFeatures();
     static bool acceptsFeatures(quint16 peerFeatures);
 
     static quint16 supportedFeatures();
     static bool acceptsFeatures(quint16 peerFeatures);
index 5aeafca..a4c7a49 100644 (file)
@@ -44,6 +44,7 @@ public:
     LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
 
     Protocol::Type protocol() const { return Protocol::LegacyProtocol; }
     LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
 
     Protocol::Type protocol() const { return Protocol::LegacyProtocol; }
+    QString protocolName() const { return "the legacy protocol"; }
 
     void setSignalProxy(SignalProxy *proxy);
 
 
     void setSignalProxy(SignalProxy *proxy);
 
index 191439e..e58d140 100644 (file)
@@ -46,6 +46,7 @@ public:
     void setSignalProxy(SignalProxy *proxy);
 
     virtual Protocol::Type protocol() const = 0;
     void setSignalProxy(SignalProxy *proxy);
 
     virtual Protocol::Type protocol() const = 0;
+    virtual QString protocolName() const = 0;
     virtual QString description() const;
     virtual quint16 enabledFeatures() const { return 0; }
 
     virtual QString description() const;
     virtual quint16 enabledFeatures() const { return 0; }
 
index 7ca6d58..36eecc1 100644 (file)
@@ -114,6 +114,8 @@ void CoreAuthHandler::onReadyRead()
 
 void CoreAuthHandler::setPeer(RemotePeer *peer)
 {
 
 void CoreAuthHandler::setPeer(RemotePeer *peer)
 {
+    qDebug().nospace() << "Using " << qPrintable(peer->protocolName()) << "...";
+
     _peer = peer;
     disconnect(socket(), SIGNAL(readyRead()), this, SLOT(onReadyRead()));
 }
     _peer = peer;
     disconnect(socket(), SIGNAL(readyRead()), this, SLOT(onReadyRead()));
 }