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

[or-cvs] [torflow/master] On second thought: keep it simple, stupid.



Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date: Tue, 5 Oct 2010 15:02:03 -0700
Subject: On second thought: keep it simple, stupid.
Commit: b9373dab8c051a5cff7a71ec8e043e81a227b2b7

Just don't display results from urls that do not have enough tests run through
them.
---
 NetworkScanners/ExitAuthority/snakeinspector.py |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/NetworkScanners/ExitAuthority/snakeinspector.py b/NetworkScanners/ExitAuthority/snakeinspector.py
index 5211ecd..b0e6726 100755
--- a/NetworkScanners/ExitAuthority/snakeinspector.py
+++ b/NetworkScanners/ExitAuthority/snakeinspector.py
@@ -219,19 +219,14 @@ def main(argv):
     else:
       if conf.cron_interval and r.timestamp < now-conf.cron_interval-60:
         continue
-    # Only apply siterate filters if enough tests have run for them to be
-    # true. Otherwise, assume they are true (don't check them).
-    if r.site_result_rate[0] and \
-      100.0/conf.siterate > (1.0*r.site_result_rate[1])/r.site_result_rate[0]:
-      if r.site_result_rate[1] != 0 and \
-          conf.siterate < (100.0*r.site_result_rate[0])/r.site_result_rate[1]:
-        continue
-    if r.exit_result_rate[0] and \
-      100.0/(100-conf.exitrate) > \
-         (1.0*r.exit_result_rate[1])/r.exit_result_rate[0]:
-      if r.exit_result_rate[1] != 0 and \
+    # Don't display sites that either do not have enough tests
+    # or have resulted in too many positive results.
+    if r.site_result_rate[1] != 0 and \
+        conf.siterate < (100.0*r.site_result_rate[0])/r.site_result_rate[1]:
+      continue
+    if r.exit_result_rate[1] != 0 and \
           conf.exitrate > (100.0*r.exit_result_rate[0])/r.exit_result_rate[1]:
-        continue
+      continue
     if (not conf.statuscode or r.status == conf.statuscode) and \
        (not conf.proto or r.proto == conf.proto) and \
        (not conf.resultfilter or r.__class__.__name__ == conf.resultfilter):
-- 
1.7.1