From 76a6b3294223f52568cd8c6190edceedbdca70ce Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 18 Oct 2017 11:59:21 +0200 Subject: HTTP/2 - make protocol settings configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/network/access/qhttp2protocolhandler_p.h | 34 +++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'src/network/access/qhttp2protocolhandler_p.h') diff --git a/src/network/access/qhttp2protocolhandler_p.h b/src/network/access/qhttp2protocolhandler_p.h index b52f8ae10c..a006663491 100644 --- a/src/network/access/qhttp2protocolhandler_p.h +++ b/src/network/access/qhttp2protocolhandler_p.h @@ -172,20 +172,38 @@ private: bool continuationExpected = false; std::vector continuedFrames; - // Peer's max number of streams ... - quint32 maxConcurrentStreams = Http2::maxConcurrentStreams; - // Control flow: - // Signed integer, it can become negative (it's still a valid window size): - qint32 sessionRecvWindowSize = Http2::initialSessionReceiveWindowSize; - - // Updated by SETTINGS and WINDOW_UPDATE. + // This is how many concurrent streams our peer expects from us: + // 100 is the default value, can be updated by the server's SETTINGS + // frame(s): + quint32 maxConcurrentStreams = Http2::maxConcurrentStreams; + // While we allow sending SETTTINGS_MAX_CONCURRENT_STREAMS to limit our peer, + // it's just a hint and we do not actually enforce it (and we can continue + // sending requests and creating streams while maxConcurrentStreams allows). + + // This is the max value, we set it in a ctor from Http2::ProtocolParameters, + // it does not change after that. + qint32 maxSessionReceiveWindowSize = Http2::defaultSessionWindowSize; + + // Our session receive window size, default is 64Kb. We'll update it from QNAM's + // Http2::ProtocolParameters. Signed integer since it can become negative + // (it's still a valid window size). + qint32 sessionReceiveWindowSize = Http2::defaultSessionWindowSize; + // Our per-stream receive window size, default is 64 Kb, will be updated + // from QNAM's Http2::ProtocolParameters. Again, signed - can become negative. + qint32 streamInitialReceiveWindowSize = Http2::defaultSessionWindowSize; + + // These are our peer's receive window sizes, they will be updated by the + // peer's SETTINGS and WINDOW_UPDATE frames. qint32 sessionSendWindowSize = Http2::defaultSessionWindowSize; qint32 streamInitialSendWindowSize = Http2::defaultSessionWindowSize; - // It's unlimited by default, but can be changed via SETTINGS. + // Our peer's header size limitations. It's unlimited by default, but can + // be changed via peer's SETTINGS frame. quint32 maxHeaderListSize = (std::numeric_limits::max)(); + // While we can send SETTINGS_MAX_HEADER_LIST_SIZE value (our limit on + // the headers size), we never enforce it, it's just a hint to our peer. Q_INVOKABLE void resumeSuspendedStreams(); // Our stream IDs (all odd), the first valid will be 1. -- cgit v1.2.3