[tor-commits] [stem/master] Invalidate cache on DNS_USELESS event

atagar at torproject.org atagar at torproject.org
Sat Aug 4 22:24:34 UTC 2018


commit d42e9e1953ab5eac3677e16c51c1a4c28ef965ec
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Aug 4 15:23:05 2018 -0700

    Invalidate cache on DNS_USELESS event
    
    Irc discussion Dave partook in indicated that we should flush our cache when we
    receive a DNS_USELESS event, not just EXTERNAL_ADDRESS.
    
      https://trac.torproject.org/projects/tor/ticket/26129
---
 stem/control.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stem/control.py b/stem/control.py
index 19a8759d..7e1d1286 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -1078,7 +1078,7 @@ class Controller(BaseController):
     self.add_event_listener(_confchanged_listener, EventType.CONF_CHANGED)
 
     def _address_changed_listener(event):
-      if event.action == 'EXTERNAL_ADDRESS':
+      if event.action in ('EXTERNAL_ADDRESS', 'DNS_USELESS'):
         self._set_cache({'exit_policy': None})
         self._set_cache({'address': None}, 'getinfo')
         self._last_address_exc = None



More information about the tor-commits mailing list