summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-04-12 21:59:27 +0200
committerLars Knoll <lars.knoll@qt.io>2018-04-12 22:00:35 +0200
commit4f158ccee56827af2a0d7b0a043c5e6cdc3bad5b (patch)
tree068d0e99a0100f64364f6490d5c1e39c34ffc2aa /src/network/access
parent5c63e6fd7541609c3fadb694c071b42e93b7acf5 (diff)
parent9c4c136bc9f29bab1cc9684dfced55a92a8bbe96 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index 5420e713b5..22541e83ba 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -212,6 +212,9 @@ QHttp2ProtocolHandler::QHttp2ProtocolHandler(QHttpNetworkConnectionChannel *chan
void QHttp2ProtocolHandler::_q_uploadDataReadyRead()
{
+ if (!sender()) // QueuedConnection, firing after sender (byte device) was deleted.
+ return;
+
auto data = qobject_cast<QNonContiguousByteDevice *>(sender());
Q_ASSERT(data);
const qint32 streamID = data->property("HTTP2StreamID").toInt();
@@ -1110,6 +1113,17 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader
if (QHttpNetworkReply::isHttpRedirect(statusCode) && redirectUrl.isValid())
httpReply->setRedirectUrl(redirectUrl);
+ if (QHttpNetworkReply::isHttpRedirect(statusCode)
+ || statusCode == 401 || statusCode == 407) {
+ // These are the status codes that can trigger uploadByteDevice->reset()
+ // in QHttpNetworkConnectionChannel::handleStatus. Alas, we have no
+ // single request/reply, we multiplex several requests and thus we never
+ // simply call 'handleStatus'. If we have byte-device - we try to reset
+ // it here, we don't (and can't) handle any error during reset operation.
+ if (stream.data())
+ stream.data()->reset();
+ }
+
if (connectionType == Qt::DirectConnection)
emit httpReply->headerChanged();
else