diff options
author | Sebastian Lösch <sebastian.loesch@governikus.com> | 2015-08-10 12:47:04 +0200 |
---|---|---|
committer | André Klitzing <aklitzing@gmail.com> | 2015-09-26 19:13:23 +0000 |
commit | f98c2ef27a4f6fa3b7e9c35cf7896abc4b22816b (patch) | |
tree | 3347def19d8e1d122777d368f871df83faea7161 /src/network/access/qhttpnetworkconnection.cpp | |
parent | f0f9f309e03accf17ffcf0a7c8df8f458a73f9f2 (diff) |
Abort underlying socket when aborting QNetworkReply
If we abort a connection in QNetworkReply::encrypted the underlying
socket gets flushed. This patch fixes that no data will be transmitted
after someone called abort().
Change-Id: I59306e69cb9f2e1421b324e11947375130e52135
Task-number: QTBUG-47471
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index b7d17be955..f810df5711 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -835,8 +835,13 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) // if HTTP mandates we should close // or the reply is not finished yet, e.g. it was aborted // we have to close that connection - if (reply->d_func()->isConnectionCloseEnabled() || !reply->isFinished()) - channels[i].close(); + if (reply->d_func()->isConnectionCloseEnabled() || !reply->isFinished()) { + if (reply->isAborted()) { + channels[i].abort(); + } else { + channels[i].close(); + } + } QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); return; |