H2: remove a rather useless limit on the number of streams
SETTINGS for max concurrect number of streams is 'one direction' - this is how our peer conveys the possible number of streams _we_ can open, not _them_. If they choose to have it unlimited - let it be so. It's possible to send 0 as maximum number, also, it's possible to reduce the maximum compared to initial at some point - then I have to avoid integer overflows. Fixes: QTBUG-94470 Change-Id: Ia02247acbaedd70998a4cab02082ba10f45cf78c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 46940ca73791e87e2366b80ac2884b3bcce716ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
635dff376e
commit
a6a2c56c96
@ -133,9 +133,6 @@ enum Http2PredefinedParameters
|
|||||||
maxPayloadSize = (1 << 24) - 1, // HTTP/2 6.5.2
|
maxPayloadSize = (1 << 24) - 1, // HTTP/2 6.5.2
|
||||||
|
|
||||||
defaultSessionWindowSize = 65535, // 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
|
maxConcurrentStreams = 100 // HTTP/2, 6.5.2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -393,7 +393,8 @@ bool QHttp2ProtocolHandler::sendRequest()
|
|||||||
initReplyFromPushPromise(message, key);
|
initReplyFromPushPromise(message, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto streamsToUse = std::min<quint32>(maxConcurrentStreams - activeStreams.size(),
|
const auto streamsToUse = std::min<quint32>(maxConcurrentStreams > activeStreams.size()
|
||||||
|
? maxConcurrentStreams - activeStreams.size() : 0,
|
||||||
requests.size());
|
requests.size());
|
||||||
auto it = requests.begin();
|
auto it = requests.begin();
|
||||||
for (quint32 i = 0; i < streamsToUse; ++i) {
|
for (quint32 i = 0; i < streamsToUse; ++i) {
|
||||||
@ -1085,13 +1086,8 @@ bool QHttp2ProtocolHandler::acceptSetting(Http2::Settings identifier, quint32 ne
|
|||||||
QMetaObject::invokeMethod(this, "resumeSuspendedStreams", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, "resumeSuspendedStreams", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (identifier == Settings::MAX_CONCURRENT_STREAMS_ID) {
|
if (identifier == Settings::MAX_CONCURRENT_STREAMS_ID)
|
||||||
if (newValue > maxPeerConcurrentStreams) {
|
|
||||||
connectionError(PROTOCOL_ERROR, "SETTINGS invalid number of concurrent streams");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
maxConcurrentStreams = newValue;
|
maxConcurrentStreams = newValue;
|
||||||
}
|
|
||||||
|
|
||||||
if (identifier == Settings::MAX_FRAME_SIZE_ID) {
|
if (identifier == Settings::MAX_FRAME_SIZE_ID) {
|
||||||
if (newValue < Http2::minPayloadLimit || newValue > Http2::maxPayloadSize) {
|
if (newValue < Http2::minPayloadLimit || newValue > Http2::maxPayloadSize) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user