Commit e8fa0922 authored by Mike Perry's avatar Mike Perry Committed by Georg Koppen
Browse files

TB2: Provide an observer event to close persistent connections

We need to prevent linkability across "New Identity", which includes closing
keep-alive connections.
parent 5f3778aa
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -350,6 +350,7 @@ nsHttpHandler::Init()
        mObserverService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, true);
        mObserverService->AddObserver(this, "net:clear-active-logins", true);
        mObserverService->AddObserver(this, "net:prune-dead-connections", true);
        mObserverService->AddObserver(this, "net:prune-all-connections", true);
        mObserverService->AddObserver(this, "net:failed-to-process-uri-content", true);
        mObserverService->AddObserver(this, "last-pb-context-exited", true);
        mObserverService->AddObserver(this, "browser:purge-session-history", true);
@@ -1942,6 +1943,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) {