Adding some debug output to NetworkConnection for the next time we run into the endless
[quassel.git] / src / core / networkconnection.h
index 649171d..83ea6f3 100644 (file)
 #include <QAbstractSocket>
 #include <QString>
 #include <QStringList>
-#include <QTcpSocket>
 #include <QTimer>
 
+#ifndef QT_NO_OPENSSL
+# include <QSslSocket>
+# include <QSslError>
+#else
+# include <QTcpSocket>
+#endif
+
 #include "identity.h"
 #include "message.h"
 #include "network.h"
@@ -120,17 +126,30 @@ signals:
   void channelJoined(NetworkId, const QString &channel, const QString &key = QString());
   void channelParted(NetworkId, const QString &channel);
 
+  void sslErrors(const QVariant &errorData);
+
 private slots:
   void socketHasData();
   void socketError(QAbstractSocket::SocketError);
   void socketConnected();
+  void socketInitialized();
   void socketDisconnected();
   void socketStateChanged(QAbstractSocket::SocketState);
   void setConnectionState(Network::ConnectionState);
   void networkInitialized(const QString &currentServer);
 
+#ifndef QT_NO_OPENSSL
+  void socketEncrypted();
+  void sslErrors(const QList<QSslError> &errors);
+#endif
+
 private:
+#ifndef QT_NO_OPENSSL
+  QSslSocket socket;
+#else
   QTcpSocket socket;
+#endif
+
   Network::ConnectionState _connectionState;
 
   Network *_network;
@@ -151,6 +170,8 @@ private:
   bool _previousConnectionAttemptFailed;
   int _lastUsedServerlistIndex;
   
+  QByteArray lastMsgReceived;  //  FIXME debug
+  
   class ParseError : public Exception {
   public:
     ParseError(QString cmd, QString prefix, QStringList params);