commit e3b67fd549bac7fbe70e992ed05e721e732684f9 Author: delber delber@riseup.net Date: Sun Sep 9 14:07:11 2012 +0000
Set 'fast exit' constraints as default for FastExitFilter --- compass.py | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/compass.py b/compass.py index 0bd823f..c3bb629 100755 --- a/compass.py +++ b/compass.py @@ -95,7 +95,9 @@ class FastExitFilter(BaseFilter): self.fp = relay.get('fingerprint') self.relay = relay
- def __init__(self, bandwidth_rate, advertised_bandwidth, ports): + def __init__(self, bandwidth_rate=FAST_EXIT_BANDWIDTH_RATE, + advertised_bandwidth=FAST_EXIT_ADVERTISED_BANDWIDTH, + ports=FAST_EXIT_PORTS): self.bandwidth_rate = bandwidth_rate self.advertised_bandwidth = advertised_bandwidth self.ports = ports @@ -220,23 +222,15 @@ class RelayStats(object): if options.guards_only: filters.append(GuardFilter()) if options.fast_exits_only: - filters.append( - SameNetworkFilter( - FastExitFilter(FAST_EXIT_BANDWIDTH_RATE, FAST_EXIT_ADVERTISED_BANDWIDTH, - FAST_EXIT_PORTS))) + filters.append(SameNetworkFilter(FastExitFilter())) if options.almost_fast_exits_only: filters.append( FastExitFilter(ALMOST_FAST_EXIT_BANDWIDTH_RATE, ALMOST_FAST_EXIT_ADVERTISED_BANDWIDTH, ALMOST_FAST_EXIT_PORTS)) filters.append( - InverseFilter( - SameNetworkFilter( - FastExitFilter(FAST_EXIT_BANDWIDTH_RATE, FAST_EXIT_ADVERTISED_BANDWIDTH, - FAST_EXIT_PORTS)))) + InverseFilter(SameNetworkFilter(FastExitFilter()))) if options.fast_exits_only_any_network: - filters.append( - FastExitFilter(FAST_EXIT_BANDWIDTH_RATE, FAST_EXIT_ADVERTISED_BANDWIDTH, - FAST_EXIT_PORTS)) + filters.append(FastExitFilter()) return filters
def _get_group_function(self, options):
tor-commits@lists.torproject.org