X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreauthhandler.cpp;h=b28952006cc7c4b295eecaf1bd151b26b0f934bd;hp=872c6d1e21179663c6857cd8a203459955c5e340;hb=c0d6dc0dec628f2e143e37ecc95cec45e636f8a5;hpb=b62292bbe3f21887dc5ee4353ca9cf675f9aa3f3 diff --git a/src/core/coreauthhandler.cpp b/src/core/coreauthhandler.cpp index 872c6d1e..b2895200 100644 --- a/src/core/coreauthhandler.cpp +++ b/src/core/coreauthhandler.cpp @@ -26,7 +26,7 @@ #include "core.h" -CoreAuthHandler::CoreAuthHandler(QTcpSocket* socket, QObject* parent) +CoreAuthHandler::CoreAuthHandler(QSslSocket* socket, QObject* parent) : AuthHandler(parent) , _peer(nullptr) , _metricsServer(Core::instance()->metricsServer()) @@ -334,18 +334,13 @@ bool CoreAuthHandler::isLocal() const void CoreAuthHandler::startSsl() { - auto* sslSocket = qobject_cast(socket()); - Q_ASSERT(sslSocket); - qDebug() << qPrintable(tr("Starting encryption for Client:")) << _peer->description(); - connect(sslSocket, selectOverload&>(&QSslSocket::sslErrors), this, &CoreAuthHandler::onSslErrors); - sslSocket->flush(); // ensure that the write cache is flushed before we switch to ssl (bug 682) - sslSocket->startServerEncryption(); + connect(socket(), selectOverload&>(&QSslSocket::sslErrors), this, &CoreAuthHandler::onSslErrors); + socket()->flush(); // ensure that the write cache is flushed before we switch to ssl (bug 682) + socket()->startServerEncryption(); } void CoreAuthHandler::onSslErrors() { - auto* sslSocket = qobject_cast(socket()); - Q_ASSERT(sslSocket); - sslSocket->ignoreSslErrors(); + socket()->ignoreSslErrors(); }