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>
bb10
Mårten Nordheim 2019-06-21 09:29:22 +02:00
parent 44d9e9b096
commit e211697962
1 changed files with 3 additions and 0 deletions

View File

@ -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)