Http2: fix some potential constness issues
The function is not const, and the access to the hash was not const, so it would check if detaching was necessary. Change-Id: Ie46cb89db20c8d9b227d50b4b6c5053dcb5791eb Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Dennis Oberst <dennis.oberst@qt.io> (cherry picked from commit ca735d8d4113490c54671e6a99a89c2379ea68da) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
3be0f9e4ea
commit
ece128fc5e
@ -1136,8 +1136,8 @@ bool QHttp2Connection::readClientPreface()
|
|||||||
void QHttp2Connection::handleConnectionClosure()
|
void QHttp2Connection::handleConnectionClosure()
|
||||||
{
|
{
|
||||||
const auto errorString = QCoreApplication::translate("QHttp", "Connection closed");
|
const auto errorString = QCoreApplication::translate("QHttp", "Connection closed");
|
||||||
for (auto it = m_streams.begin(), end = m_streams.end(); it != end; ++it) {
|
for (auto it = m_streams.cbegin(), end = m_streams.cend(); it != end; ++it) {
|
||||||
auto stream = it.value();
|
const QPointer<QHttp2Stream> &stream = it.value();
|
||||||
if (stream && stream->isActive())
|
if (stream && stream->isActive())
|
||||||
stream->finishWithError(PROTOCOL_ERROR, errorString);
|
stream->finishWithError(PROTOCOL_ERROR, errorString);
|
||||||
}
|
}
|
||||||
@ -1703,7 +1703,7 @@ void QHttp2Connection::handleWINDOW_UPDATE()
|
|||||||
if (!valid || qAddOverflow(sessionSendWindowSize, qint32(delta), &sum))
|
if (!valid || qAddOverflow(sessionSendWindowSize, qint32(delta), &sum))
|
||||||
return connectionError(PROTOCOL_ERROR, "WINDOW_UPDATE invalid delta");
|
return connectionError(PROTOCOL_ERROR, "WINDOW_UPDATE invalid delta");
|
||||||
sessionSendWindowSize = sum;
|
sessionSendWindowSize = sum;
|
||||||
for (auto &stream : m_streams) {
|
for (const auto &stream : std::as_const(m_streams)) {
|
||||||
if (!stream || !stream->isActive())
|
if (!stream || !stream->isActive())
|
||||||
continue;
|
continue;
|
||||||
// Stream may have been unblocked, so maybe try to write again
|
// Stream may have been unblocked, so maybe try to write again
|
||||||
|
Loading…
x
Reference in New Issue
Block a user