From cd0a4d1cb6fe7598f2838c7d0d88f47c979fb117 Mon Sep 17 00:00:00 2001 From: z411 Date: Wed, 27 Jul 2022 00:36:00 -0400 Subject: [PATCH] qt5: Patch to fix limit of HTTP/2 streams --- srcpkgs/qt5/patches/0005-streams-fix.patch | 43 ++++++++++++++++++++++ srcpkgs/qt5/template | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/qt5/patches/0005-streams-fix.patch diff --git a/srcpkgs/qt5/patches/0005-streams-fix.patch b/srcpkgs/qt5/patches/0005-streams-fix.patch new file mode 100644 index 000000000000..5326b3e28cc9 --- /dev/null +++ b/srcpkgs/qt5/patches/0005-streams-fix.patch @@ -0,0 +1,43 @@ +diff --git a/qtbase/src/network/access/http2/http2protocol_p.h b/qtbase/src/network/access/http2/http2protocol_p.h +index b0af5aa91921bf5229e2d54284687bafb1969eb1..ed5f2bf561f2bd62c6ef7fd1fde29e867d374603 100644 +--- a/qtbase/src/network/access/http2/http2protocol_p.h ++++ b/qtbase/src/network/access/http2/http2protocol_p.h +@@ -133,9 +133,6 @@ enum Http2PredefinedParameters + maxPayloadSize = (1 << 24) - 1, // HTTP/2 6.5.2 + + defaultSessionWindowSize = 65535, // HTTP/2 6.5.2 +- // Using 1000 (rather arbitrarily), just to +- // impose *some* upper limit: +- maxPeerConcurrentStreams = 1000, + maxConcurrentStreams = 100 // HTTP/2, 6.5.2 + }; + +diff --git a/qtbase/src/network/access/qhttp2protocolhandler.cpp b/qtbase/src/network/access/qhttp2protocolhandler.cpp +index f513139304bba375ea3c345c74f2c889b5a13938..21f1c91e29513acff83c45b6717cd5aa25609d62 100644 +--- a/qtbase/src/network/access/qhttp2protocolhandler.cpp ++++ b/qtbase/src/network/access/qhttp2protocolhandler.cpp +@@ -393,7 +393,8 @@ bool QHttp2ProtocolHandler::sendRequest() + initReplyFromPushPromise(message, key); + } + +- const auto streamsToUse = std::min(maxConcurrentStreams - activeStreams.size(), ++ const auto streamsToUse = std::min(maxConcurrentStreams > activeStreams.size() ++ ? maxConcurrentStreams - activeStreams.size() : 0, + requests.size()); + auto it = requests.begin(); + for (quint32 i = 0; i < streamsToUse; ++i) { +@@ -1084,13 +1085,8 @@ bool QHttp2ProtocolHandler::acceptSetting(Http2::Settings identifier, quint32 ne + QMetaObject::invokeMethod(this, "resumeSuspendedStreams", Qt::QueuedConnection); + } + +- if (identifier == Settings::MAX_CONCURRENT_STREAMS_ID) { +- if (newValue > maxPeerConcurrentStreams) { +- connectionError(PROTOCOL_ERROR, "SETTINGS invalid number of concurrent streams"); +- return false; +- } ++ if (identifier == Settings::MAX_CONCURRENT_STREAMS_ID) + maxConcurrentStreams = newValue; +- } + + if (identifier == Settings::MAX_FRAME_SIZE_ID) { + if (newValue < Http2::minPayloadLimit || newValue > Http2::maxPayloadSize) { diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template index c6c0a50cb60b..8bff07ad997d 100644 --- a/srcpkgs/qt5/template +++ b/srcpkgs/qt5/template @@ -3,7 +3,7 @@ pkgname=qt5 version=5.15.4+20220606 # commit 796264600e7f27ac0c88f6df3d312c0b3731772e # base repo: https://invent.kde.org/qt/qt/qt5 -revision=1 +revision=2 build_style=meta hostmakedepends="cmake clang flex perl glib-devel pkg-config python re2c ruby which"