[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/master] 4297 - Clear filtered lists of bridges properly



commit 28f72d6ca3b19fb19f9cb43d908806a5d3160181
Author: aagbsn <aagbsn@xxxxxxxx>
Date:   Sun Aug 19 16:52:33 2012 -0700

    4297 - Clear filtered lists of bridges properly
    
    The dictionary must be cleared or the filtered sets of bridges will
    not be repopulated.
---
 lib/bridgedb/Bridges.py |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py
index 8bf1f1b..3117d34 100644
--- a/lib/bridgedb/Bridges.py
+++ b/lib/bridgedb/Bridges.py
@@ -902,10 +902,8 @@ class FilteredBridgeSplitter(BridgeHolder):
         return len(self.bridges)
 
     def clear(self):
-        #XXX syntax?
-        [r.clear() for n,(f,r) in self.filterRings.items()]
         self.bridges = []
-        #self.filterRings = {}
+        self.filterRings = {}
 
     def insert(self, bridge):
         if not bridge.running:
@@ -920,11 +918,6 @@ class FilteredBridgeSplitter(BridgeHolder):
                 r.insert(bridge)
                 logging.debug("insert bridge into %s" % n)
 
-        #XXX db.insertBridgeAndGetRing ??
-        # already 'assigned' by the FixedBridgeSplitter
-        #XXX persisent mapping?
-        # the filters rebuild
-
     def addRing(self, ring, ringname, filterFn, populate_from=None):
         """Add a ring to this splitter.
         ring -- the ring to add
@@ -937,8 +930,7 @@ class FilteredBridgeSplitter(BridgeHolder):
         assert ringname not in self.filterRings.keys()
         logging.debug("addRing %s" % ringname)
 
-    #XXX: drop LRU ring if len(self.filterRings) > self.max_cached_rings
-    #XXX: where do rings go after cache eviction?
+        #TODO: drop LRU ring if len(self.filterRings) > self.max_cached_rings
         self.filterRings[ringname] = (filterFn,ring)
 
         # populate ring from an iterable
@@ -987,7 +979,7 @@ class FilteredBridgeSplitter(BridgeHolder):
             f.write("%s %s\n"%( toHex(b.getID()), desc))
 
     def assignmentsArePersistent(self):
-        return False  #XXX: is this right?
+        return False
  
 class BridgeBlock:
     """Base class that abstracts bridge blocking"""



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits