[tor-commits] [stem/master] Clearing request cache on sighup

atagar at torproject.org atagar at torproject.org
Sun Jan 20 00:03:31 UTC 2013


commit ca0375e0c47b8162c94745ec4ae6a648c9c0021c
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Jan 18 22:41:09 2013 -0800

    Clearing request cache on sighup
    
    Sighups can render our cache as being stale. Clearing it.
---
 stem/control.py                  |    3 +++
 stem/descriptor/networkstatus.py |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/stem/control.py b/stem/control.py
index 71339b2..c7c8734 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -677,6 +677,7 @@ class Controller(BaseController):
 
     def _sighup_listener(event):
       if event.signal == Signal.RELOAD:
+        self.clear_cache()
         self._notify_status_listeners(State.RESET)
 
     self.add_event_listener(_sighup_listener, EventType.SIGNAL)
@@ -693,6 +694,8 @@ class Controller(BaseController):
       except:
         pass
 
+      self.clear_cache()
+
     super(Controller, self).close()
 
   def authenticate(self, *args, **kwargs):
diff --git a/stem/descriptor/networkstatus.py b/stem/descriptor/networkstatus.py
index 1ae412e..9a12229 100644
--- a/stem/descriptor/networkstatus.py
+++ b/stem/descriptor/networkstatus.py
@@ -63,6 +63,7 @@ and upfront runtime.
     |- NetworkStatusDocumentV3 - Version 3 network status document
     +- BridgeNetworkStatusDocument - Version 3 network status document for bridges
 
+  KeyCertificate - Certificate used to authenticate an authority
   DocumentSignature - Signature of a document by a directory authority
   DirectoryAuthority - Directory authority as defined in a v3 network status document
 """





More information about the tor-commits mailing list