Http: simplify check for preconnect request
Change-Id: I132533b9bc1f2b4d66f94599efb04def571cd2ff Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
bd78047df3
commit
747dd2460b
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user