summaryrefslogtreecommitdiff
path: root/tests/auto/qsslsocket/tst_qsslsocket.cpp
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@blackberry.com>2013-04-04 11:30:43 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-24 18:03:42 +0200
commit488cb662604437b31db0667dd9e17772395f16c2 (patch)
treec9ce430944173b17dff5a77d64f5479d9a00c17f /tests/auto/qsslsocket/tst_qsslsocket.cpp
parent1df30fbd1e9ce54dd1076649162121b99700dc98 (diff)
downloadqt4-tools-488cb662604437b31db0667dd9e17772395f16c2.tar.gz
SSL internals: do not write after shutting down the socket
... but rather throw an error, so the HTTP layer can recover from a SSL shutdown gracefully. In case the other side sent us a shutdown, we tried to send one as well, which results in an error. (backport of commit e145b67fbd54f147dab0f8e460280a9c8533aa7b) Change-Id: I57291a5363cb0f6585dbd6aaa521c748766a1fdf Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'tests/auto/qsslsocket/tst_qsslsocket.cpp')
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index 880c4c2890..75f74a5f13 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -1996,7 +1996,8 @@ void tst_QSslSocket::writeBigChunk()
QFAIL("Error while writing! Check if the OpenSSL BIO size is limited?!");
}
// also check the error string. If another error (than UnknownError) occurred, it should be different than before
- QVERIFY(errorBefore == errorAfter);
+ QVERIFY2(errorBefore == errorAfter || socket->error() == QAbstractSocket::RemoteHostClosedError,
+ QByteArray("unexpected error: ").append(qPrintable(errorAfter)));
// check that everything has been written to OpenSSL
QVERIFY(socket->bytesToWrite() == 0);