diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2017-10-12 15:02:09 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2017-10-16 16:54:32 +0000 |
commit | a520c179b89610248ef97f614d6b831ccee54c6b (patch) | |
tree | 553faf7adb5aa9339ed23f062975fa85a11d8431 /src/network/access/qhttp2protocolhandler_p.h | |
parent | 65eed6d5978738b06e047c9bd5d162b2596759f7 (diff) |
HTTP/2 protocol handler: tweak receive window sizes
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 <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/access/qhttp2protocolhandler_p.h')
-rw-r--r-- | src/network/access/qhttp2protocolhandler_p.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/network/access/qhttp2protocolhandler_p.h b/src/network/access/qhttp2protocolhandler_p.h index 82eea21818..b52f8ae10c 100644 --- a/src/network/access/qhttp2protocolhandler_p.h +++ b/src/network/access/qhttp2protocolhandler_p.h @@ -176,13 +176,9 @@ private: quint32 maxConcurrentStreams = Http2::maxConcurrentStreams; // Control flow: - static const qint32 sessionMaxRecvWindowSize = Http2::defaultSessionWindowSize * 10; - // Signed integer, it can become negative (it's still a valid window size): - qint32 sessionRecvWindowSize = sessionMaxRecvWindowSize; - // We do not negotiate this window size - // We have to send WINDOW_UPDATE frames to our peer also. - static const qint32 streamInitialRecvWindowSize = Http2::defaultSessionWindowSize; + // Signed integer, it can become negative (it's still a valid window size): + qint32 sessionRecvWindowSize = Http2::initialSessionReceiveWindowSize; // Updated by SETTINGS and WINDOW_UPDATE. qint32 sessionSendWindowSize = Http2::defaultSessionWindowSize; |