diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qhttp2protocolhandler.cpp | 14 |
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 |