[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [bridgedb/master] 6175 - Make range continuous
commit 614cedb7777fc83b819db6fd0b04858b8eccdf26
Author: aagbsn <aagbsn@xxxxxxxx>
Date: Fri Jun 22 07:13:34 2012 -0700
6175 - Make range continuous
fix getNumBridgesPerAnswer so that lengths of 20 and 100 don't break the
response
---
lib/bridgedb/Dist.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py
index 0241c32..4d7ee8e 100644
--- a/lib/bridgedb/Dist.py
+++ b/lib/bridgedb/Dist.py
@@ -33,8 +33,8 @@ def uniformMap(ip):
def getNumBridgesPerAnswer(ring, max_bridges_per_answer=3):
if len(ring) < 20: n_bridges_per_answer = 1
- if 20 < len(ring) < 100: n_bridges_per_answer = min(2, max_bridges_per_answer)
- if len(ring) > 100: n_bridges_per_answer = max_bridges_per_answer
+ if 20 <= len(ring) < 100: n_bridges_per_answer = min(2, max_bridges_per_answer)
+ if len(ring) >= 100: n_bridges_per_answer = max_bridges_per_answer
logging.debug("Returning %d bridges from ring of len: %d" % \
(n_bridges_per_answer, len(ring)))
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits