summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpthreaddelegate.cpp
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-01-12 14:45:47 +0100
committerTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-07-08 16:22:32 +0000
commitb2c0f9713c1c39bc3214df49f0d2b44bcc84d790 (patch)
tree6a8eee65f90dd67968fd239606354d49f2202342 /src/network/access/qhttpthreaddelegate.cpp
parent6f61cfc33810054173a17443b20bfa2dce737285 (diff)
HTTP2 protocol handler
Add HTTP2 support in QNAM - QHttp2ProtocolHandler + aux. classes. [ChangeLog][QtNetwork] Added support for HTTP/2 protocol Task-number: QTBUG-50956 Change-Id: I3a119cfbb1fb3118d9003225f5e54b46ae2829b6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/access/qhttpthreaddelegate.cpp')
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index 3adf71ccfb..e16519c2f2 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -287,7 +287,13 @@ void QHttpThreadDelegate::startRequest()
QHttpNetworkConnection::ConnectionType connectionType
= QHttpNetworkConnection::ConnectionTypeHTTP;
#ifndef QT_NO_SSL
- if (httpRequest.isSPDYAllowed() && ssl) {
+ if (httpRequest.isHTTP2Allowed() && ssl) {
+ connectionType = QHttpNetworkConnection::ConnectionTypeHTTP2;
+ QList<QByteArray> protocols;
+ protocols << QSslConfiguration::ALPNProtocolHTTP2
+ << QSslConfiguration::NextProtocolHttp1_1;
+ incomingSslConfiguration.setAllowedNextProtocols(protocols);
+ } else if (httpRequest.isSPDYAllowed() && ssl) {
connectionType = QHttpNetworkConnection::ConnectionTypeSPDY;
urlCopy.setScheme(QStringLiteral("spdy")); // to differentiate SPDY requests from HTTPS requests
QList<QByteArray> nextProtocols;