Http2: fix streamsToUse logic
The settings frame with the max streams might be received late or be revised later, so we cannot assert something on the relation with the max streams allowed. Amends 22c99cf498103c86baa5a415ca34630396e5b6aa Pick-to: 6.7 Change-Id: I973dfcf91541becc8c3d6363f9065bb1b9183062 Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
717dc9450f
commit
b0b2b7d39d
@ -326,11 +326,10 @@ bool QHttp2ProtocolHandler::sendRequest()
|
||||
initReplyFromPushPromise(message, key);
|
||||
}
|
||||
|
||||
Q_ASSERT(qint64(maxConcurrentStreams) >= activeStreams.size());
|
||||
const size_t streamsToUse = std::min(maxConcurrentStreams - size_t(activeStreams.size()),
|
||||
size_t(requests.size()));
|
||||
const qint64 streamsToUse = qBound(0, qint64(maxConcurrentStreams) - activeStreams.size(),
|
||||
requests.size());
|
||||
auto it = requests.begin();
|
||||
for (size_t i = 0; i < streamsToUse; ++i) {
|
||||
for (qint64 i = 0; i < streamsToUse; ++i) {
|
||||
const qint32 newStreamID = createNewStream(*it);
|
||||
if (!newStreamID) {
|
||||
// TODO: actually we have to open a new connection.
|
||||
|
Loading…
x
Reference in New Issue
Block a user