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. Pick-to: 6.8 Change-Id: Ie46cb89db20c8d9b227d50b4b6c5053dcb5791eb Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
This commit is contained in:
parent
3ecbf28aa6
commit
ca735d8d41
@ -1155,8 +1155,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);
|
||||||
}
|
}
|
||||||
@ -1722,7 +1722,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