summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnection.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2019-06-21 09:20:39 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2019-06-25 17:20:35 +0200
commit89655525ae56dd9662f1873efdce72cbff7bb932 (patch)
treea11f973efcfc069a19378f1dac13290e67f9fa1d /src/network/access/qhttpnetworkconnection.cpp
parente21169796297f752a62db25c722ff8e2ff66d8dc (diff)
QHttpNetworkConnection: Change assert to early return and handle Http2
When using a http proxy (and presumably other proxies) we might have failed/aborted (aka "finished") the request and _then_ receive a "proxy authentication required" message from the proxy. In this case there is no spdy/http2 reply in the queue, so asserting is wrong. Change-Id: Id9b76b580299f6a6cd6efad62d6aaf63183816fb Fixes: QTBUG-76426 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index c58fd24a44..10c8541c5f 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -1528,19 +1528,21 @@ void QHttpNetworkConnectionPrivate::emitProxyAuthenticationRequired(const QHttpN
// dialog is displaying
pauseConnection();
QHttpNetworkReply *reply;
-#ifndef QT_NO_SSL
- if (connectionType == QHttpNetworkConnection::ConnectionTypeSPDY) {
+ if (connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2
+ || connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2Direct
+#if QT_CONFIG(ssl)
+ || connectionType == QHttpNetworkConnection::ConnectionTypeSPDY
+#endif
+ ) {
+
// we choose the reply to emit the proxyAuth signal from somewhat arbitrarily,
// but that does not matter because the signal will ultimately be emitted
// by the QNetworkAccessManager.
Q_ASSERT(chan->spdyRequestsToSend.count() > 0);
reply = chan->spdyRequestsToSend.cbegin().value().second;
} else { // HTTP
-#endif // QT_NO_SSL
reply = chan->reply;
-#ifndef QT_NO_SSL
}
-#endif // QT_NO_SSL
Q_ASSERT(reply);
emit reply->proxyAuthenticationRequired(proxy, auth);