diff options
author | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-07-14 16:49:16 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-08-03 15:31:20 +0000 |
commit | 12d71f4ea20415ff2274e1e90f9e4d5a8b935d7f (patch) | |
tree | 8ba8d02c73305bb533267bbe3784fc6e607716ad /src/network/access/qhttpnetworkconnectionchannel_p.h | |
parent | d7132c6c6d3bb9d1362744f36b2995b1d2daf4fe (diff) |
Implement protocol upgrade for HTTP/2 enabled requests
Without ALPN/NPN (== without OpenSSL) we can negotiate HTTP/2
using the protocol upgrade procedure as described by RFC7540.
Since there is no TLS handshake, after our http channel was connected
we first send an 'augmented' HTTP/1.1 request - its header
contains additional 'HTTP2-Settings' and 'Upgrade' (to 'h2c') fields.
If we receive reponse 101 (switch protocol) we re-create a protocol
handler and switch to HTTP/2.
Task-number: QTBUG-50955
Change-Id: I36e9985e06ba76edaf7fdb22bb43770f8d593c61
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel_p.h')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel_p.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h index d7d5d86a7a..a20cc1beb8 100644 --- a/src/network/access/qhttpnetworkconnectionchannel_p.h +++ b/src/network/access/qhttpnetworkconnectionchannel_p.h @@ -121,11 +121,14 @@ public: bool authenticationCredentialsSent; bool proxyCredentialsSent; QScopedPointer<QAbstractProtocolHandler> protocolHandler; + // SPDY or HTTP/2 requests; SPDY is TLS-only, but + // HTTP/2 can be cleartext also, that's why it's + // outside of QT_NO_SSL section. Sorted by priority: + QMultiMap<int, HttpMessagePair> spdyRequestsToSend; #ifndef QT_NO_SSL bool ignoreAllSslErrors; QList<QSslError> ignoreSslErrorsList; QSslConfiguration sslConfiguration; - QMultiMap<int, HttpMessagePair> spdyRequestsToSend; // sorted by priority void ignoreSslErrors(); void ignoreSslErrors(const QList<QSslError> &errors); void setSslConfiguration(const QSslConfiguration &config); @@ -192,6 +195,7 @@ public: void _q_disconnected(); // disconnected from host void _q_connected(); // start sending request void _q_error(QAbstractSocket::SocketError); // error from socket + void _q_protocolSwitch(); // HTTP/2 was negotiated to replace HTTP/1.1 #ifndef QT_NO_NETWORKPROXY void _q_proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth); // from transparent proxy #endif |