diff options
author | Christian Mollekopf <mollekopf@kolabsys.com> | 2013-10-14 22:00:19 (GMT) |
---|---|---|
committer | Christian Mollekopf <mollekopf@kolabsys.com> | 2013-10-14 22:00:19 (GMT) |
commit | 986f50e122d753ea873266f187180cf970d81477 (patch) | |
tree | 4ec529ab5d591c8a6a4c0b01f5eb4331c9108e13 | |
parent | 2f34b3689b5be523ce934a9f876e0e5e34b5dbc7 (diff) | |
download | libcalendaring-dev/kimapthreadhandling.tar.gz |
Removed the ssl fallback again.dev/kimapthreadhandling
-rw-r--r-- | kimap/sessionthread.cpp | 35 | ||||
-rw-r--r-- | kimap/sessionthread_p.h | 2 |
2 files changed, 4 insertions, 33 deletions
diff --git a/kimap/sessionthread.cpp b/kimap/sessionthread.cpp index 8db4873..6976330 100644 --- a/kimap/sessionthread.cpp +++ b/kimap/sessionthread.cpp @@ -39,8 +39,7 @@ static const int _kimap_sslErrorUiData = qRegisterMetaType<KSslErrorUiData>(); SessionThread::SessionThread( const QString &hostName, quint16 port ) : QObject(), m_hostName( hostName ), m_port( port ), m_socket( 0 ), m_stream( 0 ), m_mutex(), - m_encryptedMode( false ), - triedSslVersions( 0 ), doSslFallback( false ) + m_encryptedMode( false ) { // Just like the Qt docs now recommend, for event-driven threads: // don't derive from QThread, create one directly and move the object to it. @@ -220,24 +219,7 @@ void SessionThread::doStartSsl( KTcpSocket::SslVersion version ) Q_ASSERT( QThread::currentThread() == thread() ); if ( !m_socket ) return; - if ( version == KTcpSocket::AnySslVersion ) { - doSslFallback = true; - if ( m_socket->advertisedSslVersion() == KTcpSocket::UnknownSslVersion ) { - m_socket->setAdvertisedSslVersion( KTcpSocket::AnySslVersion ); - } else if ( !( triedSslVersions & KTcpSocket::TlsV1 ) ) { - triedSslVersions |= KTcpSocket::TlsV1; - m_socket->setAdvertisedSslVersion( KTcpSocket::TlsV1 ); - } else if ( !( triedSslVersions & KTcpSocket::SslV3 ) ) { - triedSslVersions |= KTcpSocket::SslV3; - m_socket->setAdvertisedSslVersion( KTcpSocket::SslV3 ); - } else if ( !( triedSslVersions & KTcpSocket::SslV2 ) ) { - triedSslVersions |= KTcpSocket::SslV2; - m_socket->setAdvertisedSslVersion( KTcpSocket::SslV2 ); - doSslFallback = false; - } - } else { - m_socket->setAdvertisedSslVersion(version); - } + m_socket->setAdvertisedSslVersion(version); m_socket->ignoreSslErrors(); connect(m_socket, SIGNAL(encrypted()), this, SLOT(sslConnected())); @@ -248,11 +230,7 @@ void SessionThread::doStartSsl( KTcpSocket::SslVersion version ) void SessionThread::slotSocketDisconnected() { Q_ASSERT( QThread::currentThread() == thread() ); - if ( doSslFallback ) { - reconnect(); - } else { - emit socketDisconnected(); - } + emit socketDisconnected(); } // Called in secondary thread @@ -262,11 +240,7 @@ void SessionThread::socketError(KTcpSocket::Error error) if ( !m_socket ) return; Q_UNUSED( error ); // can be used for debugging - if ( doSslFallback ) { - m_socket->disconnectFromHost(); - } else { - emit socketError(); - } + emit socketError(); } // Called in secondary thread @@ -288,7 +262,6 @@ void SessionThread::sslConnected() KSslErrorUiData errorData(m_socket); emit sslError(errorData); } else { - doSslFallback = false; qDebug() << "TLS negotiation done."; m_encryptedMode = true; emit encryptionNegotiationResult(true, m_socket->negotiatedSslVersion()); diff --git a/kimap/sessionthread_p.h b/kimap/sessionthread_p.h index 47a94fb..89c718e 100644 --- a/kimap/sessionthread_p.h +++ b/kimap/sessionthread_p.h @@ -85,8 +85,6 @@ class SessionThread : public QObject QMutex m_mutex; bool m_encryptedMode; - KTcpSocket::SslVersions triedSslVersions; - bool doSslFallback; }; } |