]> Pileus Git - ~andy/sunrise/blob - www-client/torbrowser/files/11.0/0011-Provide-an-observer-event-to-close-persistent-connec.patch
f44298274b81d1e38f1a9a38786b61fd5cc98ab7
[~andy/sunrise] / www-client / torbrowser / files / 11.0 / 0011-Provide-an-observer-event-to-close-persistent-connec.patch
1 From a0c84e27f2c40d043c85ba3b794d3578e909f558 Mon Sep 17 00:00:00 2001
2 From: Mike Perry <mikeperry-git@torproject.org>
3 Date: Wed, 1 Feb 2012 15:53:28 -0800
4 Subject: [PATCH 11/13] Provide an observer event to close persistent
5  connections
6
7 We need to prevent linkability across "New Identity", which includes closing
8 keep-alive connections.
9 ---
10  netwerk/protocol/http/nsHttpHandler.cpp |    7 +++++++
11  1 files changed, 7 insertions(+), 0 deletions(-)
12
13 diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
14 index 727b5d6..87b55bc 100644
15 --- a/netwerk/protocol/http/nsHttpHandler.cpp
16 +++ b/netwerk/protocol/http/nsHttpHandler.cpp
17 @@ -329,6 +329,7 @@ nsHttpHandler::Init()
18          mObserverService->AddObserver(this, "net:clear-active-logins", true);
19          mObserverService->AddObserver(this, NS_PRIVATE_BROWSING_SWITCH_TOPIC, true);
20          mObserverService->AddObserver(this, "net:prune-dead-connections", true);
21 +        mObserverService->AddObserver(this, "net:prune-all-connections", PR_TRUE);
22      }
23   
24      return NS_OK;
25 @@ -1533,6 +1534,12 @@ nsHttpHandler::Observe(nsISupports *subject,
26              mConnMgr->PruneDeadConnections();
27          }
28      }
29 +    else if (strcmp(topic, "net:prune-all-connections") == 0) {
30 +        if (mConnMgr) {
31 +           mConnMgr->ClosePersistentConnections();
32 +           mConnMgr->PruneDeadConnections();
33 +        }
34 +    }
35    
36      return NS_OK;
37  }
38 -- 
39 1.7.5.4
40