From 74a360e504da9192065b8722b7670be78197da46 Mon Sep 17 00:00:00 2001 From: Valentin Gosu Date: Mon, 20 Oct 2014 13:45:30 +0300 Subject: [PATCH] Bug 1057688 - Skip doing a DNSPrefetch when LOAD_NO_NETWORK_IO or ONLY_FROM_CACHE flags are present r=mcmanus --- netwerk/protocol/http/nsHttpChannel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 5164b7f7dbb1..7db6bb5dc2b7 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -4857,10 +4857,13 @@ nsHttpChannel::BeginConnect() if (mLoadFlags & VALIDATE_ALWAYS || BYPASS_LOCAL_CACHE(mLoadFlags)) mCaps |= NS_HTTP_REFRESH_DNS; - if (!mConnectionInfo->UsingHttpProxy()) { + if (!mConnectionInfo->UsingHttpProxy() && + !(mLoadFlags & (LOAD_NO_NETWORK_IO | LOAD_ONLY_FROM_CACHE))) { // Start a DNS lookup very early in case the real open is queued the DNS can // happen in parallel. Do not do so in the presence of an HTTP proxy as // all lookups other than for the proxy itself are done by the proxy. + // Also we don't do a lookup if the LOAD_NO_NETWORK_IO or + // LOAD_ONLY_FROM_CACHE flags are set. // // We keep the DNS prefetch object around so that we can retrieve // timing information from it. There is no guarantee that we actually