diff options
author | Andrew Knight <andrew.knight@digia.com> | 2014-08-27 09:02:45 +0300 |
---|---|---|
committer | Andrew Knight <andrew.knight@digia.com> | 2014-08-28 05:58:22 +0200 |
commit | 6d57f3f27e8d57b28c0788e55cfed26161ae2aca (patch) | |
tree | 333ea86eec89aecda9df123700d20fafa7d6db00 /src/network | |
parent | ecbf6dfbf5c70c7bbb840ea948699602fe14baac (diff) |
network: Add pending close on disconnect for non-empty write buffer
Similarly to 1b19f660 (which added socket flushing before close), the
socket should have a chance to disconnect if the write buffer is not
empty. Instead of flushing, the pendingClose is added so that the
backend may disconnect the socket once these bytes have been written.
Change-Id: I2d85b6356c3e158bade3d5d86161d3e33649cad6
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index aacafd2d56..b092e5e980 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1894,8 +1894,10 @@ void QSslSocket::disconnectFromHost() emit stateChanged(d->state); } - if (!d->writeBuffer.isEmpty()) + if (!d->writeBuffer.isEmpty()) { + d->pendingClose = true; return; + } if (d->mode == UnencryptedMode) { d->plainSocket->disconnectFromHost(); |