diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-08 11:33:28 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-08 11:33:28 +0200 |
commit | 1f35c8caa02eb9d27b87188f2fa21473ea694948 (patch) | |
tree | 918d3c9f20432204452ceab997e8c49dc2604319 /src/network/access/qhttpnetworkconnectionchannel.cpp | |
parent | cc32a691936f37eaaec618a71edd62f896009c9d (diff) | |
parent | 551f73bd8d745881e70a7808385f1a35c2d12b2a (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I371c5ae1af6f58e32e579671f485b92b586e0b76
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 2e9ec2d35b..d91fd8d2e6 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -850,8 +850,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; } @@ -965,7 +968,18 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket if (!reply && state == QHttpNetworkConnectionChannel::IdleState) { // 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 + // The _q_disconnected will handle the possibly pipelined replies. HTTP/2 is special for now, + // we do not resend, but must report errors if any request is in progress (note, while + // not in its sendRequest(), protocol handler switches the channel to IdleState, thus + // this check is under this condition in 'if'): + if (protocolHandler.data()) { + if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct + || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) { + auto h2Handler = static_cast<QHttp2ProtocolHandler *>(protocolHandler.data()); + h2Handler->handleConnectionClosure(); + protocolHandler.reset(); + } + } return; } else if (state != QHttpNetworkConnectionChannel::IdleState && state != QHttpNetworkConnectionChannel::ReadingState) { // Try to reconnect/resend before sending an error. |