diff options
author | Robert <krzmbrzl@gmail.com> | 2020-09-11 19:29:33 +0300 |
---|---|---|
committer | Robert <krzmbrzl@gmail.com> | 2020-09-11 19:29:33 +0300 |
commit | af7dac72f4063dd8d4dac71973ea51c25896089a (patch) | |
tree | 35558695aea94d48fd9e77d164d63fd8b7c76e90 /src/Connection.h | |
parent | 40b28b03c150b453e00c6bc4f8d6957caea59c51 (diff) |
FORMAT: Run clang-format 10 on all C/CXX source-files
Diffstat (limited to 'src/Connection.h')
-rw-r--r-- | src/Connection.h | 105 |
1 files changed, 53 insertions, 52 deletions
diff --git a/src/Connection.h b/src/Connection.h index 37ba15f0f..600551105 100644 --- a/src/Connection.h +++ b/src/Connection.h @@ -9,7 +9,7 @@ #include <QtCore/QtGlobal> #ifdef Q_OS_WIN -# include "win.h" +# include "win.h" #endif #include "crypto/CryptState.h" @@ -23,72 +23,73 @@ #include <memory> #ifdef Q_OS_WIN -# include <ws2tcpip.h> +# include <ws2tcpip.h> #endif namespace google { namespace protobuf { -class Message; -} + class Message; } +} // namespace google class Connection : public QObject { - private: - Q_OBJECT - Q_DISABLE_COPY(Connection) - protected: - QSslSocket *qtsSocket; - QElapsedTimer qtLastPacket; - unsigned int uiType; - int iPacketLength; +private: + Q_OBJECT + Q_DISABLE_COPY(Connection) +protected: + QSslSocket *qtsSocket; + QElapsedTimer qtLastPacket; + unsigned int uiType; + int iPacketLength; #ifdef Q_OS_WIN - static HANDLE hQoS; - DWORD dwFlow; + static HANDLE hQoS; + DWORD dwFlow; #endif - protected slots: - void socketRead(); - void socketError(QAbstractSocket::SocketError); - void socketDisconnected(); - void socketSslErrors(const QList<QSslError> &errors); - public slots: - void proceedAnyway(); - signals: - void encrypted(); - void connectionClosed(QAbstractSocket::SocketError, const QString &reason); - void message(unsigned int type, const QByteArray &); - void handleSslErrors(const QList<QSslError> &); - public: - Connection(QObject *parent, QSslSocket *qtsSocket); - ~Connection(); - static void messageToNetwork(const ::google::protobuf::Message &msg, unsigned int msgType, QByteArray &cache); - void sendMessage(const ::google::protobuf::Message &msg, unsigned int msgType, QByteArray &cache); - void sendMessage(const QByteArray &qbaMsg); - void disconnectSocket(bool force=false); - void forceFlush(); - qint64 activityTime() const; - void resetActivityTime(); +protected slots: + void socketRead(); + void socketError(QAbstractSocket::SocketError); + void socketDisconnected(); + void socketSslErrors(const QList< QSslError > &errors); +public slots: + void proceedAnyway(); +signals: + void encrypted(); + void connectionClosed(QAbstractSocket::SocketError, const QString &reason); + void message(unsigned int type, const QByteArray &); + void handleSslErrors(const QList< QSslError > &); + +public: + Connection(QObject *parent, QSslSocket *qtsSocket); + ~Connection(); + static void messageToNetwork(const ::google::protobuf::Message &msg, unsigned int msgType, QByteArray &cache); + void sendMessage(const ::google::protobuf::Message &msg, unsigned int msgType, QByteArray &cache); + void sendMessage(const QByteArray &qbaMsg); + void disconnectSocket(bool force = false); + void forceFlush(); + qint64 activityTime() const; + void resetActivityTime(); #ifdef MURMUR - /// qmCrypt locks access to csCrypt. - QMutex qmCrypt; + /// qmCrypt locks access to csCrypt. + QMutex qmCrypt; #endif - std::unique_ptr<CryptState> csCrypt; + std::unique_ptr< CryptState > csCrypt; - QList<QSslCertificate> peerCertificateChain() const; - QSslCipher sessionCipher() const; - QSsl::SslProtocol sessionProtocol() const; - QString sessionProtocolString() const; - QHostAddress peerAddress() const; - quint16 peerPort() const; - /// Look up the local address of this Connection. - QHostAddress localAddress() const; - /// Look up the local port of this Connection. - quint16 localPort() const; - bool bDisconnectedEmitted; + QList< QSslCertificate > peerCertificateChain() const; + QSslCipher sessionCipher() const; + QSsl::SslProtocol sessionProtocol() const; + QString sessionProtocolString() const; + QHostAddress peerAddress() const; + quint16 peerPort() const; + /// Look up the local address of this Connection. + QHostAddress localAddress() const; + /// Look up the local port of this Connection. + quint16 localPort() const; + bool bDisconnectedEmitted; - void setToS(); + void setToS(); #ifdef Q_OS_WIN - static void setQoS(HANDLE hParentQoS); + static void setQoS(HANDLE hParentQoS); #endif }; |