[or-cvs] [torflow/master] Stop scanning a slice if we hit bad restrictions.

mikeperry at torproject.org mikeperry at torproject.org
Wed Jun 23 01:06:28 UTC 2010


Author: Mike Perry <mikeperry-git at fscked.org>
Date: Tue, 22 Jun 2010 18:03:53 -0700
Subject: Stop scanning a slice if we hit bad restrictions.
Commit: a15c921047ceb9c364b5438a7a2aed09118506f1

Lets hope this doesn't cause us to abort prematurely.. It shouldn't, but we'll
need to watch for this NOTICE just in case.
---
 NetworkScanners/BwAuthority/bwauthority.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/NetworkScanners/BwAuthority/bwauthority.py b/NetworkScanners/BwAuthority/bwauthority.py
index 8ab49fa..492ebe8 100755
--- a/NetworkScanners/BwAuthority/bwauthority.py
+++ b/NetworkScanners/BwAuthority/bwauthority.py
@@ -144,8 +144,10 @@ class BwScanHandler(ScanSupport.SQLScanHandler):
     def notlambda(this):
       cond.acquire()
       # TODO: Using the entry_gen router list is somewhat ghetto..
-      if (not this.selmgr.bad_restrictions) or \
-        (this.selmgr.path_selector.entry_gen.rstr_routers and \
+      if this.selmgr.bad_restrictions:
+        plog("NOTICE",
+          "Bad restrictions on last attempt. Declaring this slice finished")
+      elif (this.selmgr.path_selector.entry_gen.rstr_routers and \
           this.selmgr.path_selector.exit_gen.rstr_routers):
         for r in this.selmgr.path_selector.entry_gen.rstr_routers:
           if r._generated[position] < count:
-- 
1.7.1



More information about the tor-commits mailing list