QHttpNetworkConnectionChannel - avoid re-connecting on 'disconnected'

The _q_error slot has a special case for RemoteHostClosedError,
where the current channel's state is 'idle' and no request/reply
is in progress. The comment states that:

"Not actually an error, it is normal for Keep-Alive connections
 to close after some time if no request is sent on them. No need
 to error the other replies below. Just bail out here. The _q_disconnected
 will handle the possibly pipelined replies."

_q_disconnected, indeed, takes care about pipelined replies ... calling
'ensureConnected' even if we have 0 replies in pipeline, which makes
zero sense to me and results in QNAM endlessly trying to re-connect
to the server.

Fixes: QTBUG-77852
Change-Id: I6dcb43b36a6d432bc940246a08f65e1ee903fd24
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Timur Pocheptsov 2019-09-02 10:43:29 +02:00
parent 6bb51e0f08
commit dbfa374a86

View File

@ -849,8 +849,11 @@ void QHttpNetworkConnectionChannel::_q_disconnected()
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
}
state = QHttpNetworkConnectionChannel::IdleState;
requeueCurrentlyPipelinedRequests();
if (alreadyPipelinedRequests.length()) {
// If nothing was in a pipeline, no need in calling
// _q_startNextRequest (which it does):
requeueCurrentlyPipelinedRequests();
}
pendingEncrypt = false;
}