[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [torflow/master] 4127 - refill_targets uses wrong type
commit cd20ea690b831732bef9870358c03ef44a5f42c8
Author: aagbsn <aagbsn@xxxxxxxx>
Date: Mon Sep 26 20:23:09 2011 -0700
4127 - refill_targets uses wrong type
refill_targets maps add_target to a list of urls
add_target expects tuple (url, filetype) and adds
a target ('h', 't') -- probably from 'http://...'
---
NetworkScanners/ExitAuthority/soat.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/NetworkScanners/ExitAuthority/soat.py b/NetworkScanners/ExitAuthority/soat.py
index dbb763b..4db34a2 100755
--- a/NetworkScanners/ExitAuthority/soat.py
+++ b/NetworkScanners/ExitAuthority/soat.py
@@ -1884,9 +1884,12 @@ class SearchBasedHTTPTest(SearchBasedTest, BaseHTTPTest):
def refill_targets(self):
for ftype in self.scan_filetypes:
targets_needed = self.results_per_type - len(self.targets.bykey(ftype))
+ urllist = set([])
if targets_needed > 0:
plog("NOTICE", self.proto+" scanner short on "+ftype+" targets. Adding more")
- map(self.add_target, self.get_search_urls_for_filetype(ftype,targets_needed))
+ #map(self.add_target, self.get_search_urls_for_filetype(ftype,targets_needed))
+ urllist.update(map(lambda x: (x, ftype), self.get_search_urls_for_filetype(ftype, targets_needed)))
+ map(self.add_target, urllist)
def add_target(self, target):
self.targets.add(target[0],[target[1]])
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits