mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1302488 - Alt-Svc Hard Refresh Race r=hurley
This commit is contained in:
parent
abfa4e2d89
commit
14f8754356
@ -5737,6 +5737,7 @@ nsHttpChannel::BeginConnect()
|
||||
|
||||
RefPtr<AltSvcMapping> mapping;
|
||||
if (!mConnectionInfo && mAllowAltSvc && // per channel
|
||||
!(mLoadFlags & LOAD_FRESH_CONNECTION) &&
|
||||
(scheme.Equals(NS_LITERAL_CSTRING("http")) ||
|
||||
scheme.Equals(NS_LITERAL_CSTRING("https"))) &&
|
||||
(!proxyInfo || proxyInfo->IsDirect()) &&
|
||||
|
@ -145,7 +145,7 @@ function makeChan(origin) {
|
||||
var origin;
|
||||
var xaltsvc;
|
||||
var retryCounter = 0;
|
||||
var loadWithoutAltSvc = false;
|
||||
var loadWithoutClearingMappings = false;
|
||||
var nextTest;
|
||||
var expectPass = true;
|
||||
var waitFor = 0;
|
||||
@ -180,6 +180,7 @@ Listener.prototype = {
|
||||
if (waitFor != 0) {
|
||||
do_check_eq(routed, "");
|
||||
do_test_pending();
|
||||
loadWithoutClearingMappings = true;
|
||||
do_timeout(waitFor, doTest);
|
||||
waitFor = 0;
|
||||
xaltsvc = "NA";
|
||||
@ -192,6 +193,7 @@ Listener.prototype = {
|
||||
} else {
|
||||
dump ("poll later for alt svc mapping\n");
|
||||
do_test_pending();
|
||||
loadWithoutClearingMappings = true;
|
||||
do_timeout(500, doTest);
|
||||
}
|
||||
|
||||
@ -217,8 +219,13 @@ function doTest()
|
||||
if (xaltsvc != "NA") {
|
||||
chan.setRequestHeader("x-altsvc", xaltsvc, false);
|
||||
}
|
||||
chan.loadFlags = Ci.nsIRequest.LOAD_FRESH_CONNECTION |
|
||||
Ci.nsIChannel.LOAD_INITIAL_DOCUMENT_URI;
|
||||
if (loadWithoutClearingMappings) {
|
||||
chan.loadFlags = Ci.nsIChannel.LOAD_INITIAL_DOCUMENT_URI;
|
||||
} else {
|
||||
chan.loadFlags = Ci.nsIRequest.LOAD_FRESH_CONNECTION |
|
||||
Ci.nsIChannel.LOAD_INITIAL_DOCUMENT_URI;
|
||||
}
|
||||
loadWithoutClearingMappings = false;
|
||||
chan.asyncOpen2(listener);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user