summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard J. Moore <rich@kde.org>2014-05-25 21:39:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-26 15:06:12 +0200
commit1b19f66037bd4942b7e699628f9bd8bde89a69bb (patch)
treeb2c6658f56fff2be321e0b88f86edb7c293bc2e0
parent787c0d76a2d7dbc6d7493915f4f765ac19a14062 (diff)
Ensure all encrypted bytes are sent when closing QSslSocket.
If you do sock->write(data) followed by sock->close() then the data written is not transmitted unless you flush when using QSslSocket but is when using QTcpSocket. This change makes QSslSocket work like QTcpSocket. Change-Id: Ia2e1c021dc48ac0d573f78da782ea77641c03bc1 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
-rw-r--r--src/network/ssl/qsslsocket.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index c5ae517fb0..de6e879a71 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -777,6 +777,8 @@ void QSslSocket::close()
qDebug() << "QSslSocket::close()";
#endif
Q_D(QSslSocket);
+ if (encryptedBytesToWrite())
+ flush();
if (d->plainSocket)
d->plainSocket->close();
QTcpSocket::close();