From babdeb7a10df5b70e36f43ba5657ba4ef6dbfa66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 5 Jul 2023 15:12:24 +0200 Subject: [PATCH] http2: inline a couple static variables It looks cleaner when it's declared where it's defined. Change-Id: I5006fc086c73e6d4891bc64ff3a8c6b4b17623fe Reviewed-by: Timur Pocheptsov --- src/network/access/qhttp2protocolhandler.cpp | 3 --- src/network/access/qhttp2protocolhandler_p.h | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index fe5d7ae9ce..90be29eea2 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -125,9 +125,6 @@ QUrl urlkey_from_request(const QHttpNetworkRequest &request) // Since we anyway end up having this in every function definition: using namespace Http2; -const std::deque::size_type QHttp2ProtocolHandler::maxRecycledStreams = 10000; -const quint32 QHttp2ProtocolHandler::maxAcceptableTableSize; - QHttp2ProtocolHandler::QHttp2ProtocolHandler(QHttpNetworkConnectionChannel *channel) : QAbstractProtocolHandler(channel), decoder(HPack::FieldLookupTable::DefaultSize), diff --git a/src/network/access/qhttp2protocolhandler_p.h b/src/network/access/qhttp2protocolhandler_p.h index c4340d7eeb..b75e3eb93e 100644 --- a/src/network/access/qhttp2protocolhandler_p.h +++ b/src/network/access/qhttp2protocolhandler_p.h @@ -120,7 +120,7 @@ private: // the client's preface 24-byte message. bool waitingForSettingsACK = false; - static const quint32 maxAcceptableTableSize = 16 * HPack::FieldLookupTable::DefaultSize; + inline static const quint32 maxAcceptableTableSize = 16 * HPack::FieldLookupTable::DefaultSize; // HTTP/2 4.3: Header compression is stateful. One compression context and // one decompression context are used for the entire connection. HPack::Decoder decoder; @@ -129,7 +129,7 @@ private: QHash streamIDs; QHash activeStreams; std::deque suspendedStreams[3]; // 3 for priorities: High, Normal, Low. - static const std::deque::size_type maxRecycledStreams; + inline static const std::deque::size_type maxRecycledStreams = 10000; std::deque recycledStreams; // Peer's max frame size (this min is the default value