From cb8a8afe425e6362afe84941cd3f6b73bb39932d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 27 Jun 2024 15:40:39 +0200 Subject: [PATCH] QHttp2Connection: properly count only the active streams For a function whose only purpose is to count active streams it was missing a quite important aspect. Change-Id: I9110949c0f00acc9fb3bc115f7a66e0c0f4502d0 Reviewed-by: Dennis Oberst Reviewed-by: Alexey Edelev (cherry picked from commit 3fe9c38053774ea3dd6b20d14dd664dd8464208c) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/qhttp2connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qhttp2connection.cpp b/src/network/access/qhttp2connection.cpp index 8560e0da386..891b5bb99ed 100644 --- a/src/network/access/qhttp2connection.cpp +++ b/src/network/access/qhttp2connection.cpp @@ -823,7 +823,7 @@ QHttp2Stream *QHttp2Connection::createStreamInternal_impl(quint32 streamID) qsizetype QHttp2Connection::numActiveStreamsImpl(quint32 mask) const noexcept { const auto shouldCount = [mask](const QPointer &stream) -> bool { - return stream && (stream->streamID() & 1) == mask; + return stream && (stream->streamID() & 1) == mask && stream->isActive(); }; return std::count_if(m_streams.cbegin(), m_streams.cend(), shouldCount); }