[Pkg-privacy-commits] [txtorcon] 27/96: add all_routers set() to TorControlProtocol

Jérémy Bobbio lunar at moszumanska.debian.org
Sun Sep 6 18:33:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository txtorcon.

commit caeb93c84487d37e1d62577447622337deb386f3
Author: meejah <meejah at meejah.ca>
Date:   Sat Jan 17 00:45:39 2015 -0700

    add all_routers set() to TorControlProtocol
---
 txtorcon/torstate.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/txtorcon/torstate.py b/txtorcon/torstate.py
index 08de977..a151a75 100644
--- a/txtorcon/torstate.py
+++ b/txtorcon/torstate.py
@@ -193,6 +193,7 @@ class TorState(object):
         self.circuits = {}               # keys on id (integer)
         self.streams = {}                # keys on id (integer)
 
+        self.all_routers = set()         # list of unique routers
         self.routers = {}                # keys by hexid (string) and by unique names
         self.routers_by_name = {}        # keys on name, value always list (many duplicate "Unnamed" routers, for example)
         self.routers_by_hash = {}        # keys by hexid (string)
@@ -285,6 +286,7 @@ class TorState(object):
             self.routers[self._router.name] = self._router
         self.routers[self._router.id_hex] = self._router
         self.routers_by_hash[self._router.id_hex] = self._router
+        self.all_routers.add(self._router)
 
     def _router_flags(self, data):
         args = data.split()
@@ -633,6 +635,7 @@ class TorState(object):
         from NS and NEWCONSENSUS events.
         """
 
+        self.all_routers = set()
         for line in data.split('\n'):
             self._network_status_parser.process(line)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/txtorcon.git



More information about the Pkg-privacy-commits mailing list