Bug 962358 - Provide an observer event to close persistent connections. r=arthuredelstein

We need to prevent linkability across "New Identity", which includes closing
keep-alive connections.

Conflicts:
	netwerk/protocol/http/nsHttpHandler.cpp
This commit is contained in:
Mike Perry 2015-09-15 20:35:00 +02:00
parent 4e656d71a0
commit 2d25043442

View File

@ -365,6 +365,8 @@ nsHttpHandler::Init()
obsService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, true);
obsService->AddObserver(this, "net:clear-active-logins", true);
obsService->AddObserver(this, "net:prune-dead-connections", true);
// Sent by the TorButton add-on in the Tor Browser
obsService->AddObserver(this, "net:prune-all-connections", true);
obsService->AddObserver(this, "net:failed-to-process-uri-content", true);
obsService->AddObserver(this, "last-pb-context-exited", true);
obsService->AddObserver(this, "webapps-clear-data", true);
@ -2044,6 +2046,11 @@ nsHttpHandler::Observe(nsISupports *subject,
if (mConnMgr) {
mConnMgr->PruneDeadConnections();
}
} else if (!strcmp(topic, "net:prune-all-connections")) {
if (mConnMgr) {
mConnMgr->DoShiftReloadConnectionCleanup(nullptr);
mConnMgr->PruneDeadConnections();
}
} else if (!strcmp(topic, "net:failed-to-process-uri-content")) {
nsCOMPtr<nsIURI> uri = do_QueryInterface(subject);
if (uri && mConnMgr) {