summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2019-06-21 09:29:22 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2019-06-24 19:11:04 +0200
commite21169796297f752a62db25c722ff8e2ff66d8dc (patch)
treef04e66034b57deab87875419071f88a1c5f70195 /src/network
parent44d9e9b096738a79b6bceffcdad20da42f2e3713 (diff)
QHttpNetworkConnectionChannel: don't close if we're already closing
In some scenarios with QNAM we call socket->close, leading to a flush, leading to an error, leading to another error emission... To work around this scenario we stop trying to close the socket if the network channel is already closing. Change-Id: Id15504f476484ce61f11ba83a5755ceb5f581f9b Fixes: QTBUG-76567 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index d5f63af745..074c389689 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -207,6 +207,9 @@ void QHttpNetworkConnectionChannel::init()
void QHttpNetworkConnectionChannel::close()
{
+ if (state == QHttpNetworkConnectionChannel::ClosingState)
+ return;
+
if (!socket)
state = QHttpNetworkConnectionChannel::IdleState;
else if (socket->state() == QAbstractSocket::UnconnectedState)