/***************************************************************************
- * Copyright (C) 2005-2014 by the Quassel Project *
+ * Copyright (C) 2005-2019 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#define COREAUTHHANDLER_H
#include "authhandler.h"
+#include "peerfactory.h"
#include "remotepeer.h"
#include "types.h"
Q_OBJECT
public:
- CoreAuthHandler(QTcpSocket *socket, QObject *parent = 0);
+ CoreAuthHandler(QTcpSocket* socket, QObject* parent = nullptr);
signals:
- void handshakeComplete(RemotePeer *peer, UserId uid);
+ void handshakeComplete(RemotePeer* peer, UserId uid);
private:
using AuthHandler::handle;
- void handle(const Protocol::RegisterClient &msg);
- void handle(const Protocol::SetupData &msg);
- void handle(const Protocol::Login &msg);
+ void handle(const Protocol::RegisterClient& msg) override;
+ void handle(const Protocol::SetupData& msg) override;
+ void handle(const Protocol::Login& msg) override;
+
+ void setPeer(RemotePeer* peer);
+ void startSsl();
bool checkClientRegistered();
private slots:
- void startSsl();
+ void onReadyRead();
+
#ifdef HAVE_SSL
void onSslErrors();
#endif
- // only in compat mode
+ // only in legacy mode
void onProtocolVersionMismatch(int actual, int expected);
private:
- RemotePeer *_peer;
+ RemotePeer* _peer;
+ bool _magicReceived;
+ bool _legacy;
bool _clientRegistered;
+ quint8 _connectionFeatures;
+ QVector<PeerFactory::ProtoDescriptor> _supportedProtos;
};
#endif