diff --git a/src/base/http/server.cpp b/src/base/http/server.cpp index c6df59e3c..d89534656 100644 --- a/src/base/http/server.cpp +++ b/src/base/http/server.cpp @@ -86,15 +86,15 @@ void Server::incomingConnection(int socketDescriptor) if (serverSocket->setSocketDescriptor(socketDescriptor)) { #ifndef QT_NO_OPENSSL if (m_https) { - static_cast(serverSocket)->setProtocol(QSsl::SecureProtocols); - static_cast(serverSocket)->setPrivateKey(m_key); + static_cast(serverSocket)->setProtocol(QSsl::SecureProtocols); + static_cast(serverSocket)->setPrivateKey(m_key); #ifdef QBT_USES_QT5 - static_cast(serverSocket)->setLocalCertificateChain(m_certificates); + static_cast(serverSocket)->setLocalCertificateChain(m_certificates); #else - static_cast(serverSocket)->setLocalCertificate(m_certificates.first()); + static_cast(serverSocket)->setLocalCertificate(m_certificates.first()); #endif - static_cast(serverSocket)->setPeerVerifyMode(QSslSocket::VerifyNone); - static_cast(serverSocket)->startServerEncryption(); + static_cast(serverSocket)->setPeerVerifyMode(QSslSocket::VerifyNone); + static_cast(serverSocket)->startServerEncryption(); } #endif new Connection(serverSocket, m_requestHandler, this); diff --git a/src/base/http/server.h b/src/base/http/server.h index bc1f6d493..b4eb492c3 100644 --- a/src/base/http/server.h +++ b/src/base/http/server.h @@ -44,7 +44,7 @@ namespace Http class IRequestHandler; class Connection; - class Server : public QTcpServer + class Server: public QTcpServer { Q_OBJECT Q_DISABLE_COPY(Server) @@ -53,25 +53,25 @@ namespace Http Server(IRequestHandler *requestHandler, QObject *parent = 0); ~Server(); - #ifndef QT_NO_OPENSSL +#ifndef QT_NO_OPENSSL void enableHttps(const QList &certificates, const QSslKey &key); void disableHttps(); - #endif +#endif private: - #ifdef QBT_USES_QT5 + IRequestHandler *m_requestHandler; + +#ifdef QBT_USES_QT5 void incomingConnection(qintptr socketDescriptor); - #else +#else void incomingConnection(int socketDescriptor); - #endif +#endif - private: - IRequestHandler *m_requestHandler; - #ifndef QT_NO_OPENSSL +#ifndef QT_NO_OPENSSL bool m_https; QList m_certificates; QSslKey m_key; - #endif +#endif }; }