Commit 5d96c216 authored by Volker Krause's avatar Volker Krause
Browse files

Connect QSslSocket::encrypted only once

We can enter startSsl() multiple times, when a socket is reconnected in
Session, which then would result in multiple connections. Connecting it
earlier OTOH shouldn't hurt, so connect it together with the rest of the
socket signals after construction.

We'll also need this for starting encryption earlier than in LoginJob.
parent 327d2b1c
Pipeline #80785 passed with stage
in 3 minutes and 46 seconds
......@@ -134,6 +134,7 @@ void SessionThread::run()
m_socket = std::make_unique<QSslSocket>();
connect(m_socket.get(), &QSslSocket::readyRead, this, &SessionThread::readResponse, Qt::QueuedConnection);
connect(m_socket.get(), &QSslSocket::encrypted, this, &SessionThread::sslConnected);
connect(m_socket.get(), &QSslSocket::disconnected, m_parentSession->d, &SessionPrivate::socketDisconnected);
connect(m_socket.get(), &QSslSocket::connected, m_parentSession->d, &SessionPrivate::socketConnected);
......@@ -193,7 +194,6 @@ void SessionThread::startSsl()
QMutexLocker locker(&m_mutex);
m_socket->ignoreSslErrors(); // don't worry, we DO handle the errors ourselves below
connect(m_socket.get(), &QSslSocket::encrypted, this, &SessionThread::sslConnected);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment