summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpthreaddelegate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/access/qhttpthreaddelegate.cpp')
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index 3204f8da33..0e97acdd9d 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -50,8 +50,6 @@
#include "private/qnetworkaccesscache_p.h"
#include "private/qnoncontiguousbytedevice_p.h"
-#ifndef QT_NO_HTTP
-
QT_BEGIN_NAMESPACE
static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url)
@@ -197,7 +195,7 @@ public:
setShareable(true);
}
- virtual void dispose() Q_DECL_OVERRIDE
+ virtual void dispose() override
{
#if 0 // sample code; do this right with the API
Q_ASSERT(!isWorking());
@@ -292,11 +290,17 @@ void QHttpThreadDelegate::startRequest()
QHttpNetworkConnection::ConnectionType connectionType
= httpRequest.isHTTP2Allowed() ? QHttpNetworkConnection::ConnectionTypeHTTP2
: QHttpNetworkConnection::ConnectionTypeHTTP;
+ if (httpRequest.isHTTP2Direct()) {
+ Q_ASSERT(!httpRequest.isHTTP2Allowed());
+ connectionType = QHttpNetworkConnection::ConnectionTypeHTTP2Direct;
+ }
+
#ifndef QT_NO_SSL
if (ssl && !incomingSslConfiguration.data())
incomingSslConfiguration.reset(new QSslConfiguration);
if (httpRequest.isHTTP2Allowed() && ssl) {
+ // With HTTP2Direct we do not try any protocol negotiation.
QList<QByteArray> protocols;
protocols << QSslConfiguration::ALPNProtocolHTTP2
<< QSslConfiguration::NextProtocolHttp1_1;
@@ -762,6 +766,4 @@ void QHttpThreadDelegate::synchronousProxyAuthenticationRequiredSlot(const QNet
#endif
-#endif // QT_NO_HTTP
-
QT_END_NAMESPACE