diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 08fccd0f5863..5c40ca543dcc 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -2551,7 +2551,7 @@ nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, void *param) if (preferredEntry) ent = preferredEntry; - if (mNumHalfOpenConns <= gHttpHandler->ParallelSpeculativeConnectLimit() && + if (mNumHalfOpenConns < gHttpHandler->ParallelSpeculativeConnectLimit() && !ent->mIdleConns.Length() && !RestrictConnections(ent) && !AtActiveConnectionLimit(ent, trans->Caps())) { CreateTransport(ent, trans, trans->Caps(), true); diff --git a/netwerk/test/unit/test_spdy.js b/netwerk/test/unit/test_spdy.js index d388b3864c61..a9a5969753b2 100644 --- a/netwerk/test/unit/test_spdy.js +++ b/netwerk/test/unit/test_spdy.js @@ -331,13 +331,18 @@ function addCertOverride(host, port, bits) { function run_test() { // Set to allow the cert presented by our SPDY server do_get_profile(); + var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); + var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit"); + prefs.setIntPref("network.http.speculative-parallel-limit", 0); + addCertOverride("localhost", 4443, Ci.nsICertOverrideService.ERROR_UNTRUSTED | Ci.nsICertOverrideService.ERROR_MISMATCH | Ci.nsICertOverrideService.ERROR_TIME); + prefs.setIntPref("network.http.speculative-parallel-limit", oldPref); + // Make sure spdy is enabled - var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); prefs.setBoolPref("network.http.spdy.enabled", true); // And make go!