summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-13 12:41:51 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-13 12:41:51 (GMT)
commit8a3b4e1e66fb7cdcf1a5aa518e1cc31eaba72236 (patch)
tree5723faef2c962c03497e8ba59e0026cd20ce536f
parent413ad2471afea9f82134942c2c1e5cfe22479139 (diff)
parentf7fe575bc5f628533aeeca3eb564af89a1a1426b (diff)
downloadQt-8a3b4e1e66fb7cdcf1a5aa518e1cc31eaba72236.zip
Qt-8a3b4e1e66fb7cdcf1a5aa518e1cc31eaba72236.tar.gz
Qt-8a3b4e1e66fb7cdcf1a5aa518e1cc31eaba72236.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QSslSocket: Improve error handling
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index ce2aee1..6f77600 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -680,8 +680,20 @@ void QSslSocketBackendPrivate::transmit()
#endif
plainSocket->disconnectFromHost();
break;
+ case SSL_ERROR_SYSCALL: // some IO error
+ case SSL_ERROR_SSL: // error in the SSL library
+ // we do not know exactly what the error is, nor whether we can recover from it,
+ // so just return to prevent an endless loop in the outer "while" statement
+ q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
+ q->setSocketError(QAbstractSocket::UnknownSocketError);
+ emit q->error(QAbstractSocket::UnknownSocketError);
+ return;
default:
- // ### Handle errors better.
+ // SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT: can only happen with a
+ // BIO_s_connect() or BIO_s_accept(), which we do not call.
+ // SSL_ERROR_WANT_X509_LOOKUP: can only happen with a
+ // SSL_CTX_set_client_cert_cb(), which we do not call.
+ // So this default case should never be triggered.
q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);