path: root/src/network/access/http2/http2protocol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* HTTP/2 - make protocol settings configurablev5.10.0-beta3Timur Pocheptsov2017-10-261-29/+100
| | | | | | | | | | | | | | | | | | | | | | 1. Recently we have updated our receive window size to a larger value. Unfortunately, this also results in auto-test pumping through more data, which probably takes more time on CI. At the moment we do not have any public API on QNAM's level to customize HTTP/2 parameters (aka 5.10/FF and so on). So we use the fact that QNAM is QObject and we can set a property on it. This property is our Http2::ProtocolParameters object that allows us to configure: - HPACK parameters (in 5.10 - noop) - session receive window size - different SETTINGS as described by RFC 7540, 6.5.2. 2. Undocumented environment variable to set ENABLE_PUSH is not needed anymore. 3. In 5.11 Http2::ProtocolParameter will become a public API and we'll introduce a new setter in QNAM. Change-Id: If08fd5e09e7c0b61cf9700b426b60b5837b6b2e6 Reviewed-by: MÃ¥rten Nordheim <> Reviewed-by: Edward Welbourne <>
* HTTP/2 protocol handler: tweak receive window sizesTimur Pocheptsov2017-10-161-0/+2
| | | | | | | | | | | | | | | | | We were using the default ones, provided by RFC7540. It appears they are way too restrictive and conservative: when downloading something relatively big, a stream keeps spending the whole session/its own 'recv' windows and thus we have to constantly send WINDOW_UPDATE frames. This significantly slows down our HTTP/2 implementation, making it orders of magnitude slower than HTTP/1.1. To fix this: - We send SETTINGS_INITIAL_WINDOW_SIZE in the first SETTINGS frame to inform our peer that per-stream WINDOW is bigger than 64Kb - We increase the session's receive window size. Task-number: QTBUG-63722 Change-Id: I31312fcfd5f0fc0aee6aaa5d3562cc7d1b931adc Reviewed-by: Edward Welbourne <>
* HTTP/2 - implement the proper 'h2c' (protocol upgrade)Timur Pocheptsov2017-08-271-2/+73
| | | | | | | | | | | | | | | | | | | | | | | | | Without TLS (and thus ALPN/NPN negotiation) HTTP/2 requires a protocol upgrade procedure, as described in RFC 7540, 3.2. We start as HTTP/1.1 (and thus we create QHttpProtocolHandler first), augmenting the headers we send with 'Upgrade: h2c'. In case we receive HTTP/1.1 response with status code 101 ('Switching Protocols'), we continue as HTTP/2 session, creating QHttp2ProtocolHandler and pretending the first request we sent was HTTP/2 request on a real HTTP/2 stream. If the first response is something different from 101, we continue as HTTP/1.1. This change also required auto-test update: our toy-server now has to respond to the initial HTTP/1.1 request on a platform without ALPN/NPN. As a bonus a subtle flakyness in 'goaway' auto-test went away (well, it was fixed). [ChangeLog][QtNetwork][HTTP/2] In case of clear text HTTP/2 we now initiate a required protocol upgrade procedure instead of 'H2Direct' connection. Task-number: QTBUG-61397 Change-Id: I573fa304fdaf661490159037dc47775d97c8ea5b Reviewed-by: Edward Welbourne <> Reviewed-by: Timur Pocheptsov <>
* Revert "Implement protocol upgrade for HTTP/2 enabled requests"Timur Pocheptsov2016-08-041-47/+0
| | | | | | | | | This reverts commit 12d71f4ea20415ff2274e1e90f9e4d5a8b935d7f. This change is breaking a build + incomplete as my test revealed. Will have to re-try later. Change-Id: I7ea089093a832aa5822caaaac56e62f5fda4df17 Reviewed-by: Liang Qi <>
* Implement protocol upgrade for HTTP/2 enabled requestsTimur Pocheptsov2016-08-031-0/+47
| | | | | | | | | | | | | | 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 <>
* HTTP2 protocol handlerTimur Pocheptsov2016-07-081-0/+156
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 <>