Http: simplify check for preconnect request

Change-Id: I132533b9bc1f2b4d66f94599efb04def571cd2ff
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Mårten Nordheim 2022-11-04 13:00:59 +01:00
parent bd78047df3
commit 747dd2460b
2 changed files with 2 additions and 4 deletions

View File

@ -309,8 +309,7 @@ bool QHttp2ProtocolHandler::sendRequest()
auto &requests = m_channel->h2RequestsToSend;
for (auto it = requests.begin(), endIt = requests.end(); it != endIt;) {
const auto &pair = *it;
const QString scheme(pair.first.url().scheme());
if (scheme == "preconnect-http"_L1 || scheme == "preconnect-https"_L1) {
if (pair.first.isPreConnect()) {
m_connection->preConnectFinished();
emit pair.second->finished();
it = requests.erase(it);

View File

@ -238,8 +238,7 @@ bool QHttpProtocolHandler::sendRequest()
// _q_connected or _q_encrypted
return false;
}
QString scheme = m_channel->request.url().scheme();
if (scheme == "preconnect-http"_L1 || scheme == "preconnect-https"_L1) {
if (m_channel->request.isPreConnect()) {
m_channel->state = QHttpNetworkConnectionChannel::IdleState;
m_reply->d_func()->state = QHttpNetworkReplyPrivate::AllDoneState;
m_channel->allDone();