#632: M1362498 M1397686 M136178 M1320252 M1355875
This commit is contained in:
parent
d87db7e160
commit
82cb3b59e5
|
@ -1415,7 +1415,7 @@ pref("network.http.spdy.enabled.http2", true);
|
||||||
pref("network.http.spdy.enabled.deps", true);
|
pref("network.http.spdy.enabled.deps", true);
|
||||||
pref("network.http.spdy.enforce-tls-profile", true);
|
pref("network.http.spdy.enforce-tls-profile", true);
|
||||||
pref("network.http.spdy.chunk-size", 16000);
|
pref("network.http.spdy.chunk-size", 16000);
|
||||||
pref("network.http.spdy.timeout", 180);
|
pref("network.http.spdy.timeout", 170);
|
||||||
pref("network.http.spdy.coalesce-hostnames", true);
|
pref("network.http.spdy.coalesce-hostnames", true);
|
||||||
pref("network.http.spdy.persistent-settings", false);
|
pref("network.http.spdy.persistent-settings", false);
|
||||||
pref("network.http.spdy.ping-threshold", 58);
|
pref("network.http.spdy.ping-threshold", 58);
|
||||||
|
|
|
@ -18,7 +18,7 @@ struct PRFileDesc;
|
||||||
[ptr] native PRFileDescPtr(PRFileDesc);
|
[ptr] native PRFileDescPtr(PRFileDesc);
|
||||||
[ptr] native nsASocketHandlerPtr(nsASocketHandler);
|
[ptr] native nsASocketHandlerPtr(nsASocketHandler);
|
||||||
|
|
||||||
[scriptable, uuid(ad56b25f-e6bb-4db3-9f7b-5b7db33fd2b1)]
|
[builtinclass, scriptable, uuid(ad56b25f-e6bb-4db3-9f7b-5b7db33fd2b1)]
|
||||||
interface nsISocketTransportService : nsISupports
|
interface nsISocketTransportService : nsISupports
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -119,7 +119,7 @@ interface nsISocketTransportService : nsISupports
|
||||||
[noscript] void notifyWhenCanAttachSocket(in nsIRunnable aEvent);
|
[noscript] void notifyWhenCanAttachSocket(in nsIRunnable aEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
[scriptable, uuid(c5204623-5b58-4a16-8b2e-67c34dd02e3f)]
|
[builtinclass, scriptable, uuid(c5204623-5b58-4a16-8b2e-67c34dd02e3f)]
|
||||||
interface nsIRoutedSocketTransportService : nsISocketTransportService
|
interface nsIRoutedSocketTransportService : nsISocketTransportService
|
||||||
{
|
{
|
||||||
// use this instead of createTransport when you have a transport
|
// use this instead of createTransport when you have a transport
|
||||||
|
|
|
@ -15,7 +15,7 @@ interface nsIOutputStream;
|
||||||
* into a fully asynchronous stream that can be read/written without
|
* into a fully asynchronous stream that can be read/written without
|
||||||
* blocking the main thread.
|
* blocking the main thread.
|
||||||
*/
|
*/
|
||||||
[scriptable, uuid(5e0adf7d-9785-45c3-a193-04f25a75da8f)]
|
[builtinclass, scriptable, uuid(5e0adf7d-9785-45c3-a193-04f25a75da8f)]
|
||||||
interface nsIStreamTransportService : nsISupports
|
interface nsIStreamTransportService : nsISupports
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
* This is a private interface used by the internals of the networking library.
|
* This is a private interface used by the internals of the networking library.
|
||||||
* It will never be frozen. Do not use it in external code.
|
* It will never be frozen. Do not use it in external code.
|
||||||
*/
|
*/
|
||||||
[scriptable, uuid(18f73bf1-b35b-4b7b-aa9a-11bcbdbc389c)]
|
[builtinclass, scriptable, uuid(18f73bf1-b35b-4b7b-aa9a-11bcbdbc389c)]
|
||||||
|
|
||||||
interface nsPISocketTransportService : nsIRoutedSocketTransportService
|
interface nsPISocketTransportService : nsIRoutedSocketTransportService
|
||||||
{
|
{
|
||||||
|
|
|
@ -1290,6 +1290,16 @@ nsProtocolProxyService::AsyncResolveInternal(nsIChannel *channel, uint32_t flags
|
||||||
nsCOMPtr<nsIProxyInfo> pi;
|
nsCOMPtr<nsIProxyInfo> pi;
|
||||||
bool usePACThread;
|
bool usePACThread;
|
||||||
|
|
||||||
|
// adapt to realtime changes in the system proxy service
|
||||||
|
if (mProxyConfig == PROXYCONFIG_SYSTEM) {
|
||||||
|
nsCOMPtr<nsISystemProxySettings> sp2 =
|
||||||
|
do_GetService(NS_SYSTEMPROXYSETTINGS_CONTRACTID);
|
||||||
|
if (sp2 != mSystemProxySettings) {
|
||||||
|
mSystemProxySettings = sp2;
|
||||||
|
ResetPACThread();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// SystemProxySettings and PAC files can block the main thread
|
// SystemProxySettings and PAC files can block the main thread
|
||||||
// but if neither of them are in use, we can just do the work
|
// but if neither of them are in use, we can just do the work
|
||||||
// right here and directly invoke the callback
|
// right here and directly invoke the callback
|
||||||
|
|
|
@ -2369,6 +2369,9 @@ Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader,
|
||||||
this, stream, stream->StreamID()));
|
this, stream, stream->StreamID()));
|
||||||
FlushOutputQueue();
|
FlushOutputQueue();
|
||||||
SetWriteCallbacks();
|
SetWriteCallbacks();
|
||||||
|
if (!mCannotDo0RTTStreams.Contains(stream)) {
|
||||||
|
mCannotDo0RTTStreams.AppendElement(stream);
|
||||||
|
}
|
||||||
// We can still send our preamble
|
// We can still send our preamble
|
||||||
*countRead = mOutputQueueUsed - mOutputQueueSent;
|
*countRead = mOutputQueueUsed - mOutputQueueSent;
|
||||||
return *countRead ? NS_OK : NS_BASE_STREAM_WOULD_BLOCK;
|
return *countRead ? NS_OK : NS_BASE_STREAM_WOULD_BLOCK;
|
||||||
|
@ -2396,10 +2399,10 @@ Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader,
|
||||||
*countRead += earlyDataUsed;
|
*countRead += earlyDataUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAttemptingEarlyData && !m0RTTStreams.Contains(stream->StreamID())) {
|
if (mAttemptingEarlyData && !m0RTTStreams.Contains(stream)) {
|
||||||
LOG3(("Http2Session::ReadSegmentsAgain adding stream %d to m0RTTStreams\n",
|
LOG3(("Http2Session::ReadSegmentsAgain adding stream %d to m0RTTStreams\n",
|
||||||
stream->StreamID()));
|
stream->StreamID()));
|
||||||
m0RTTStreams.AppendElement(stream->StreamID());
|
m0RTTStreams.AppendElement(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not every permutation of stream->ReadSegents produces data (and therefore
|
// Not every permutation of stream->ReadSegents produces data (and therefore
|
||||||
|
@ -2966,9 +2969,8 @@ Http2Session::Finish0RTT(bool aRestart, bool aAlpnChanged)
|
||||||
// the transaction rewind and read it all over again. We only need to rewind
|
// the transaction rewind and read it all over again. We only need to rewind
|
||||||
// the transaction if we're switching to a new protocol, because our buffer
|
// the transaction if we're switching to a new protocol, because our buffer
|
||||||
// won't get used in that case.
|
// won't get used in that case.
|
||||||
Http2Stream *stream = mStreamIDHash.Get(m0RTTStreams[i]);
|
if (m0RTTStreams[i]) {
|
||||||
if (stream) {
|
m0RTTStreams[i]->Finish0RTT(aRestart, aAlpnChanged);
|
||||||
stream->Finish0RTT(aAlpnChanged, aAlpnChanged);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2990,15 +2992,27 @@ Http2Session::Finish0RTT(bool aRestart, bool aAlpnChanged)
|
||||||
// This is the easy case - early data failed, but we're speaking h2, so
|
// This is the easy case - early data failed, but we're speaking h2, so
|
||||||
// we just need to rewind to the beginning of the preamble and try again.
|
// we just need to rewind to the beginning of the preamble and try again.
|
||||||
mOutputQueueSent = 0;
|
mOutputQueueSent = 0;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < mCannotDo0RTTStreams.Length(); ++i) {
|
||||||
|
if (mCannotDo0RTTStreams[i] && VerifyStream(mCannotDo0RTTStreams[i])) {
|
||||||
|
TransactionHasDataToWrite(mCannotDo0RTTStreams[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 0RTT succeeded
|
// 0RTT succeeded
|
||||||
|
for (size_t i = 0; i < mCannotDo0RTTStreams.Length(); ++i) {
|
||||||
|
if (mCannotDo0RTTStreams[i] && VerifyStream(mCannotDo0RTTStreams[i])) {
|
||||||
|
TransactionHasDataToWrite(mCannotDo0RTTStreams[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
// Make sure we look for any incoming data in repsonse to our early data.
|
// Make sure we look for any incoming data in repsonse to our early data.
|
||||||
ResumeRecv();
|
ResumeRecv();
|
||||||
}
|
}
|
||||||
|
|
||||||
mAttemptingEarlyData = false;
|
mAttemptingEarlyData = false;
|
||||||
m0RTTStreams.Clear();
|
m0RTTStreams.Clear();
|
||||||
|
mCannotDo0RTTStreams.Clear();
|
||||||
RealignOutputQueue();
|
RealignOutputQueue();
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -510,7 +510,10 @@ private:
|
||||||
|
|
||||||
bool mAttemptingEarlyData;
|
bool mAttemptingEarlyData;
|
||||||
// The ID(s) of the stream(s) that we are getting 0RTT data from.
|
// The ID(s) of the stream(s) that we are getting 0RTT data from.
|
||||||
nsTArray<uint32_t> m0RTTStreams;
|
nsTArray<WeakPtr<Http2Stream>> m0RTTStreams;
|
||||||
|
// The ID(s) of the stream(s) that are not able to send 0RTT data. We need to
|
||||||
|
// remember them put them into mReadyForWrite queue when 0RTT finishes.
|
||||||
|
nsTArray<WeakPtr<Http2Stream>> mCannotDo0RTTStreams;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// connect tunnels
|
/// connect tunnels
|
||||||
|
|
|
@ -114,8 +114,6 @@ static uint64_t gNumIntercepted = 0;
|
||||||
(result) == NS_ERROR_OUT_OF_MEMORY)
|
(result) == NS_ERROR_OUT_OF_MEMORY)
|
||||||
|
|
||||||
static NS_DEFINE_CID(kStreamListenerTeeCID, NS_STREAMLISTENERTEE_CID);
|
static NS_DEFINE_CID(kStreamListenerTeeCID, NS_STREAMLISTENERTEE_CID);
|
||||||
static NS_DEFINE_CID(kStreamTransportServiceCID,
|
|
||||||
NS_STREAMTRANSPORTSERVICE_CID);
|
|
||||||
|
|
||||||
enum CacheDisposition {
|
enum CacheDisposition {
|
||||||
kCacheHit = 1,
|
kCacheHit = 1,
|
||||||
|
@ -2998,9 +2996,10 @@ nsHttpChannel::OpenCacheEntry(bool isHttps)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsICacheStorageService> cacheStorageService =
|
nsCOMPtr<nsICacheStorageService> cacheStorageService(services::GetCacheStorageService());
|
||||||
do_GetService("@mozilla.org/netwerk/cache-storage-service;1", &rv);
|
if (!cacheStorageService) {
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsICacheStorage> cacheStorage;
|
nsCOMPtr<nsICacheStorage> cacheStorage;
|
||||||
nsCOMPtr<nsIURI> openURI;
|
nsCOMPtr<nsIURI> openURI;
|
||||||
|
@ -4058,8 +4057,8 @@ nsHttpChannel::OpenCacheInputStream(nsICacheEntry* cacheEntry, bool startBufferi
|
||||||
nsCOMPtr<nsITransport> transport;
|
nsCOMPtr<nsITransport> transport;
|
||||||
nsCOMPtr<nsIInputStream> wrapper;
|
nsCOMPtr<nsIInputStream> wrapper;
|
||||||
|
|
||||||
nsCOMPtr<nsIStreamTransportService> sts =
|
nsCOMPtr<nsIStreamTransportService> sts(services::GetStreamTransportService());
|
||||||
do_GetService(kStreamTransportServiceCID, &rv);
|
rv = sts ? NS_OK : NS_ERROR_NOT_AVAILABLE;
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
rv = sts->CreateInputTransport(stream, int64_t(-1), int64_t(-1),
|
rv = sts->CreateInputTransport(stream, int64_t(-1), int64_t(-1),
|
||||||
true, getter_AddRefs(transport));
|
true, getter_AddRefs(transport));
|
||||||
|
@ -4579,9 +4578,10 @@ nsHttpChannel::InstallCacheListener(int64_t offset)
|
||||||
|
|
||||||
nsCOMPtr<nsIEventTarget> cacheIOTarget;
|
nsCOMPtr<nsIEventTarget> cacheIOTarget;
|
||||||
if (!CacheObserver::UseNewCache()) {
|
if (!CacheObserver::UseNewCache()) {
|
||||||
nsCOMPtr<nsICacheStorageService> serv =
|
nsCOMPtr<nsICacheStorageService> serv(services::GetCacheStorageService());
|
||||||
do_GetService("@mozilla.org/netwerk/cache-storage-service;1", &rv);
|
if (!serv) {
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
serv->GetIoTarget(getter_AddRefs(cacheIOTarget));
|
serv->GetIoTarget(getter_AddRefs(cacheIOTarget));
|
||||||
}
|
}
|
||||||
|
@ -5288,7 +5288,7 @@ nsHttpChannel::BeginConnect()
|
||||||
// Check to see if this principal exists on local blocklists.
|
// Check to see if this principal exists on local blocklists.
|
||||||
RefPtr<nsChannelClassifier> channelClassifier = new nsChannelClassifier();
|
RefPtr<nsChannelClassifier> channelClassifier = new nsChannelClassifier();
|
||||||
if (mLoadFlags & LOAD_CLASSIFY_URI) {
|
if (mLoadFlags & LOAD_CLASSIFY_URI) {
|
||||||
nsCOMPtr<nsIURIClassifier> classifier = do_GetService(NS_URICLASSIFIERSERVICE_CONTRACTID);
|
nsCOMPtr<nsIURIClassifier> classifier(services::GetURIClassifier());
|
||||||
bool tpEnabled = false;
|
bool tpEnabled = false;
|
||||||
channelClassifier->ShouldEnableTrackingProtection(this, &tpEnabled);
|
channelClassifier->ShouldEnableTrackingProtection(this, &tpEnabled);
|
||||||
if (classifier && tpEnabled) {
|
if (classifier && tpEnabled) {
|
||||||
|
@ -7004,8 +7004,8 @@ nsHttpChannel::DoInvalidateCacheEntry(nsIURI* aURI)
|
||||||
|
|
||||||
LOG(("DoInvalidateCacheEntry [channel=%p key=%s]", this, key.get()));
|
LOG(("DoInvalidateCacheEntry [channel=%p key=%s]", this, key.get()));
|
||||||
|
|
||||||
nsCOMPtr<nsICacheStorageService> cacheStorageService =
|
nsCOMPtr<nsICacheStorageService> cacheStorageService(services::GetCacheStorageService());
|
||||||
do_GetService("@mozilla.org/netwerk/cache-storage-service;1", &rv);
|
rv = cacheStorageService ? NS_OK : NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsCOMPtr<nsICacheStorage> cacheStorage;
|
nsCOMPtr<nsICacheStorage> cacheStorage;
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "mozilla/net/DNS.h"
|
#include "mozilla/net/DNS.h"
|
||||||
#include "nsISocketTransport.h"
|
#include "nsISocketTransport.h"
|
||||||
#include "nsISSLSocketControl.h"
|
#include "nsISSLSocketControl.h"
|
||||||
|
#include "mozilla/Services.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "mozilla/net/DashboardTypes.h"
|
#include "mozilla/net/DashboardTypes.h"
|
||||||
#include "NullHttpTransaction.h"
|
#include "NullHttpTransaction.h"
|
||||||
|
@ -101,11 +102,13 @@ nsHttpConnectionMgr::~nsHttpConnectionMgr()
|
||||||
nsresult
|
nsresult
|
||||||
nsHttpConnectionMgr::EnsureSocketThreadTarget()
|
nsHttpConnectionMgr::EnsureSocketThreadTarget()
|
||||||
{
|
{
|
||||||
nsresult rv;
|
|
||||||
nsCOMPtr<nsIEventTarget> sts;
|
nsCOMPtr<nsIEventTarget> sts;
|
||||||
nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);
|
nsCOMPtr<nsIIOService> ioService = services::GetIOService();
|
||||||
if (NS_SUCCEEDED(rv))
|
if (ioService) {
|
||||||
sts = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
|
nsCOMPtr<nsISocketTransportService> realSTS =
|
||||||
|
services::GetSocketTransportService();
|
||||||
|
sts = do_QueryInterface(realSTS);
|
||||||
|
}
|
||||||
|
|
||||||
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
||||||
|
|
||||||
|
@ -115,7 +118,7 @@ nsHttpConnectionMgr::EnsureSocketThreadTarget()
|
||||||
|
|
||||||
mSocketThreadTarget = sts;
|
mSocketThreadTarget = sts;
|
||||||
|
|
||||||
return rv;
|
return sts ? NS_OK : NS_ERROR_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -853,7 +856,7 @@ nsHttpConnectionMgr::GetSpdyPreferredEnt(nsConnectionEntry *aOriginalEntry)
|
||||||
"with %s connections. rv=%x isJoined=%d",
|
"with %s connections. rv=%x isJoined=%d",
|
||||||
preferred->mConnInfo->Origin(), aOriginalEntry->mConnInfo->Origin(),
|
preferred->mConnInfo->Origin(), aOriginalEntry->mConnInfo->Origin(),
|
||||||
rv, isJoined));
|
rv, isJoined));
|
||||||
Telemetry::Accumulate(Telemetry::SPDY_NPN_JOIN, false);
|
//Telemetry::Accumulate(Telemetry::SPDY_NPN_JOIN, false);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -863,7 +866,7 @@ nsHttpConnectionMgr::GetSpdyPreferredEnt(nsConnectionEntry *aOriginalEntry)
|
||||||
"so %s will be coalesced with %s",
|
"so %s will be coalesced with %s",
|
||||||
preferred->mConnInfo->Origin(), aOriginalEntry->mConnInfo->Origin(),
|
preferred->mConnInfo->Origin(), aOriginalEntry->mConnInfo->Origin(),
|
||||||
aOriginalEntry->mConnInfo->Origin(), preferred->mConnInfo->Origin()));
|
aOriginalEntry->mConnInfo->Origin(), preferred->mConnInfo->Origin()));
|
||||||
Telemetry::Accumulate(Telemetry::SPDY_NPN_JOIN, true);
|
//Telemetry::Accumulate(Telemetry::SPDY_NPN_JOIN, true);
|
||||||
return preferred;
|
return preferred;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1401,6 +1404,7 @@ nsHttpConnectionMgr::MakeNewConnection(nsConnectionEntry *ent,
|
||||||
transport->SetConnectionFlags(flags);
|
transport->SetConnectionFlags(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if(0)
|
||||||
Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_USED_SPECULATIVE_CONN> usedSpeculativeConn;
|
Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_USED_SPECULATIVE_CONN> usedSpeculativeConn;
|
||||||
++usedSpeculativeConn;
|
++usedSpeculativeConn;
|
||||||
|
|
||||||
|
@ -1408,6 +1412,7 @@ nsHttpConnectionMgr::MakeNewConnection(nsConnectionEntry *ent,
|
||||||
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRECONNECTS_USED> totalPreconnectsUsed;
|
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRECONNECTS_USED> totalPreconnectsUsed;
|
||||||
++totalPreconnectsUsed;
|
++totalPreconnectsUsed;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// return OK because we have essentially opened a new connection
|
// return OK because we have essentially opened a new connection
|
||||||
// by converting a speculative half-open to general use
|
// by converting a speculative half-open to general use
|
||||||
|
@ -2053,6 +2058,7 @@ nsHttpConnectionMgr::BuildPipeline(nsConnectionEntry *ent,
|
||||||
void
|
void
|
||||||
nsHttpConnectionMgr::ReportProxyTelemetry(nsConnectionEntry *ent)
|
nsHttpConnectionMgr::ReportProxyTelemetry(nsConnectionEntry *ent)
|
||||||
{
|
{
|
||||||
|
#if(0)
|
||||||
enum { PROXY_NONE = 1, PROXY_HTTP = 2, PROXY_SOCKS = 3, PROXY_HTTPS = 4 };
|
enum { PROXY_NONE = 1, PROXY_HTTP = 2, PROXY_SOCKS = 3, PROXY_HTTPS = 4 };
|
||||||
|
|
||||||
if (!ent->mConnInfo->UsingProxy())
|
if (!ent->mConnInfo->UsingProxy())
|
||||||
|
@ -2063,6 +2069,7 @@ nsHttpConnectionMgr::ReportProxyTelemetry(nsConnectionEntry *ent)
|
||||||
Telemetry::Accumulate(Telemetry::HTTP_PROXY_TYPE, PROXY_HTTP);
|
Telemetry::Accumulate(Telemetry::HTTP_PROXY_TYPE, PROXY_HTTP);
|
||||||
else
|
else
|
||||||
Telemetry::Accumulate(Telemetry::HTTP_PROXY_TYPE, PROXY_SOCKS);
|
Telemetry::Accumulate(Telemetry::HTTP_PROXY_TYPE, PROXY_SOCKS);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -2110,7 +2117,7 @@ nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans)
|
||||||
ent = preferredEntry;
|
ent = preferredEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReportProxyTelemetry(ent);
|
//ReportProxyTelemetry(ent);
|
||||||
|
|
||||||
// Check if the transaction already has a sticky reference to a connection.
|
// Check if the transaction already has a sticky reference to a connection.
|
||||||
// If so, then we can just use it directly by transferring its reference
|
// If so, then we can just use it directly by transferring its reference
|
||||||
|
@ -2210,13 +2217,13 @@ nsHttpConnectionMgr::CreateTransport(nsConnectionEntry *ent,
|
||||||
if (speculative) {
|
if (speculative) {
|
||||||
sock->SetSpeculative(true);
|
sock->SetSpeculative(true);
|
||||||
sock->SetAllow1918(allow1918);
|
sock->SetAllow1918(allow1918);
|
||||||
Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_TOTAL_SPECULATIVE_CONN> totalSpeculativeConn;
|
//Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_TOTAL_SPECULATIVE_CONN> totalSpeculativeConn;
|
||||||
++totalSpeculativeConn;
|
//++totalSpeculativeConn;
|
||||||
|
|
||||||
if (isFromPredictor) {
|
if (isFromPredictor) {
|
||||||
sock->SetIsFromPredictor(true);
|
sock->SetIsFromPredictor(true);
|
||||||
Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRECONNECTS_CREATED> totalPreconnectsCreated;
|
//Telemetry::AutoCounter<Telemetry::PREDICTOR_TOTAL_PRECONNECTS_CREATED> totalPreconnectsCreated;
|
||||||
++totalPreconnectsCreated;
|
//++totalPreconnectsCreated;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3090,8 +3097,10 @@ nsHalfOpenSocket::SetupStreams(nsISocketTransport **transport,
|
||||||
nsCOMPtr<nsISocketTransport> socketTransport;
|
nsCOMPtr<nsISocketTransport> socketTransport;
|
||||||
nsCOMPtr<nsISocketTransportService> sts;
|
nsCOMPtr<nsISocketTransportService> sts;
|
||||||
|
|
||||||
sts = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
|
sts = services::GetSocketTransportService();
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
if (!sts) {
|
||||||
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
LOG(("nsHalfOpenSocket::SetupStreams [this=%p ent=%s] "
|
LOG(("nsHalfOpenSocket::SetupStreams [this=%p ent=%s] "
|
||||||
"setup routed transport to origin %s:%d via %s:%d\n",
|
"setup routed transport to origin %s:%d via %s:%d\n",
|
||||||
|
@ -3167,8 +3176,10 @@ nsHalfOpenSocket::SetupStreams(nsISocketTransport **transport,
|
||||||
rv = socketTransport->SetSecurityCallbacks(this);
|
rv = socketTransport->SetSecurityCallbacks(this);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
/*
|
||||||
Telemetry::Accumulate(Telemetry::HTTP_CONNECTION_ENTRY_CACHE_HIT_1,
|
Telemetry::Accumulate(Telemetry::HTTP_CONNECTION_ENTRY_CACHE_HIT_1,
|
||||||
mEnt->mUsedForConnection);
|
mEnt->mUsedForConnection);
|
||||||
|
*/
|
||||||
mEnt->mUsedForConnection = true;
|
mEnt->mUsedForConnection = true;
|
||||||
|
|
||||||
nsCOMPtr<nsIOutputStream> sout;
|
nsCOMPtr<nsIOutputStream> sout;
|
||||||
|
@ -3967,6 +3978,7 @@ nsConnectionEntry::RemoveHalfOpen(nsHalfOpenSocket *halfOpen)
|
||||||
// will result in it not being present in the halfopen table. That's expected.
|
// will result in it not being present in the halfopen table. That's expected.
|
||||||
if (mHalfOpens.RemoveElement(halfOpen)) {
|
if (mHalfOpens.RemoveElement(halfOpen)) {
|
||||||
|
|
||||||
|
#if(0)
|
||||||
if (halfOpen->IsSpeculative()) {
|
if (halfOpen->IsSpeculative()) {
|
||||||
Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_UNUSED_SPECULATIVE_CONN> unusedSpeculativeConn;
|
Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_UNUSED_SPECULATIVE_CONN> unusedSpeculativeConn;
|
||||||
++unusedSpeculativeConn;
|
++unusedSpeculativeConn;
|
||||||
|
@ -3976,6 +3988,7 @@ nsConnectionEntry::RemoveHalfOpen(nsHalfOpenSocket *halfOpen)
|
||||||
++totalPreconnectsUnused;
|
++totalPreconnectsUnused;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
MOZ_ASSERT(gHttpHandler->ConnMgr()->mNumHalfOpenConns);
|
MOZ_ASSERT(gHttpHandler->ConnMgr()->mNumHalfOpenConns);
|
||||||
if (gHttpHandler->ConnMgr()->mNumHalfOpenConns) { // just in case
|
if (gHttpHandler->ConnMgr()->mNumHalfOpenConns) { // just in case
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include "nsStringStream.h"
|
#include "nsStringStream.h"
|
||||||
|
|
||||||
#include "nsComponentManagerUtils.h" // do_CreateInstance
|
#include "nsComponentManagerUtils.h" // do_CreateInstance
|
||||||
#include "nsServiceManagerUtils.h" // do_GetService
|
|
||||||
#include "nsIHttpActivityObserver.h"
|
#include "nsIHttpActivityObserver.h"
|
||||||
#include "nsSocketTransportService2.h"
|
#include "nsSocketTransportService2.h"
|
||||||
#include "nsICancelable.h"
|
#include "nsICancelable.h"
|
||||||
|
@ -235,8 +234,10 @@ nsHttpTransaction::Init(uint32_t caps,
|
||||||
MOZ_ASSERT(requestHead);
|
MOZ_ASSERT(requestHead);
|
||||||
MOZ_ASSERT(target);
|
MOZ_ASSERT(target);
|
||||||
|
|
||||||
mActivityDistributor = do_GetService(NS_HTTPACTIVITYDISTRIBUTOR_CONTRACTID, &rv);
|
mActivityDistributor = services::GetActivityDistributor();
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (!mActivityDistributor) {
|
||||||
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
bool activityDistributorActive;
|
bool activityDistributorActive;
|
||||||
rv = mActivityDistributor->GetIsActive(&activityDistributorActive);
|
rv = mActivityDistributor->GetIsActive(&activityDistributorActive);
|
||||||
|
|
|
@ -322,23 +322,34 @@ nsNSSSocketInfo::GetNegotiatedNPN(nsACString& aNegotiatedNPN)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsNSSSocketInfo::GetAlpnEarlySelection(nsACString& aAlpnSelected)
|
nsNSSSocketInfo::GetAlpnEarlySelection(nsACString& aAlpnSelected)
|
||||||
{
|
{
|
||||||
|
aAlpnSelected.Truncate();
|
||||||
|
|
||||||
nsNSSShutDownPreventionLock locker;
|
nsNSSShutDownPreventionLock locker;
|
||||||
if (isAlreadyShutDown() || isPK11LoggedOut()) {
|
if (isAlreadyShutDown() || isPK11LoggedOut()) {
|
||||||
return NS_ERROR_NOT_AVAILABLE;
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
SSLNextProtoState alpnState;
|
|
||||||
unsigned char chosenAlpn[MAX_ALPN_LENGTH];
|
|
||||||
unsigned int chosenAlpnLen;
|
|
||||||
SECStatus rv = SSL_GetNextProto(mFd, &alpnState, chosenAlpn, &chosenAlpnLen,
|
|
||||||
AssertedCast<unsigned int>(ArrayLength(chosenAlpn)));
|
|
||||||
|
|
||||||
if (rv != SECSuccess || alpnState != SSL_NEXT_PROTO_EARLY_VALUE ||
|
SSLPreliminaryChannelInfo info;
|
||||||
chosenAlpnLen == 0) {
|
SECStatus rv = SSL_GetPreliminaryChannelInfo(mFd, &info, sizeof(info));
|
||||||
|
if (rv != SECSuccess || !info.canSendEarlyData) {
|
||||||
return NS_ERROR_NOT_AVAILABLE;
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
aAlpnSelected.Assign(BitwiseCast<char*, unsigned char*>(chosenAlpn),
|
SSLNextProtoState alpnState;
|
||||||
chosenAlpnLen);
|
unsigned char chosenAlpn[MAX_ALPN_LENGTH];
|
||||||
|
unsigned int chosenAlpnLen;
|
||||||
|
rv = SSL_GetNextProto(mFd, &alpnState, chosenAlpn, &chosenAlpnLen,
|
||||||
|
AssertedCast<unsigned int>(ArrayLength(chosenAlpn)));
|
||||||
|
|
||||||
|
if (rv != SECSuccess) {
|
||||||
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (alpnState == SSL_NEXT_PROTO_EARLY_VALUE) {
|
||||||
|
aAlpnSelected.Assign(BitwiseCast<char*, unsigned char*>(chosenAlpn),
|
||||||
|
chosenAlpnLen);
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,16 @@ MOZ_SERVICE(UUIDGenerator, nsIUUIDGenerator,
|
||||||
"@mozilla.org/uuid-generator;1");
|
"@mozilla.org/uuid-generator;1");
|
||||||
MOZ_SERVICE(GfxInfo, nsIGfxInfo,
|
MOZ_SERVICE(GfxInfo, nsIGfxInfo,
|
||||||
"@mozilla.org/gfx/info;1");
|
"@mozilla.org/gfx/info;1");
|
||||||
|
MOZ_SERVICE(SocketTransportService, nsISocketTransportService,
|
||||||
|
"@mozilla.org/network/socket-transport-service;1");
|
||||||
|
MOZ_SERVICE(StreamTransportService, nsIStreamTransportService,
|
||||||
|
"@mozilla.org/network/stream-transport-service;1");
|
||||||
|
MOZ_SERVICE(CacheStorageService, nsICacheStorageService,
|
||||||
|
"@mozilla.org/netwerk/cache-storage-service;1");
|
||||||
|
MOZ_SERVICE(URIClassifier, nsIURIClassifier,
|
||||||
|
"@mozilla.org/uriclassifierservice");
|
||||||
|
MOZ_SERVICE(ActivityDistributor, nsIHttpActivityDistributor,
|
||||||
|
"@mozilla.org/network/http-activity-distributor;1");
|
||||||
|
|
||||||
#ifdef MOZ_USE_NAMESPACE
|
#ifdef MOZ_USE_NAMESPACE
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
|
@ -26,6 +26,11 @@
|
||||||
#include "inIDOMUtils.h"
|
#include "inIDOMUtils.h"
|
||||||
#include "nsIPermissionManager.h"
|
#include "nsIPermissionManager.h"
|
||||||
#include "nsIServiceWorkerManager.h"
|
#include "nsIServiceWorkerManager.h"
|
||||||
|
#include "nsICacheStorageService.h"
|
||||||
|
#include "nsIStreamTransportService.h"
|
||||||
|
#include "nsISocketTransportService.h"
|
||||||
|
#include "nsIURIClassifier.h"
|
||||||
|
#include "nsIHttpActivityObserver.h"
|
||||||
#include "nsIAsyncShutdown.h"
|
#include "nsIAsyncShutdown.h"
|
||||||
#include "nsIUUIDGenerator.h"
|
#include "nsIUUIDGenerator.h"
|
||||||
#include "nsIGfxInfo.h"
|
#include "nsIGfxInfo.h"
|
||||||
|
|
Loading…
Reference in New Issue