[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [chutney/master] Don't burn through a client's HSDirs too fast in hs-min
commit aad22037a2498697b81fdf74c9ece4dc21a08d30
Author: teor (Tim Wilson-Brown) <teor2345@xxxxxxxxx>
Date: Mon Jul 18 12:53:46 2016 +1000
Don't burn through a client's HSDirs too fast in hs-min
---
lib/chutney/Traffic.py | 7 ++++---
networks/hs-min | 4 +++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/chutney/Traffic.py b/lib/chutney/Traffic.py
index c118289..881cac7 100644
--- a/lib/chutney/Traffic.py
+++ b/lib/chutney/Traffic.py
@@ -291,11 +291,12 @@ class Source(Peer):
else:
debug("BUG: sent no bytes")
self._sent_no_bytes += 1
- if self._sent_no_bytes >= 10:
+ # We can't retry too fast, otherwise clients burn all their HSDirs
+ if self._sent_no_bytes >= 3:
print("Send no data %d times. Stalled." %
(self._sent_no_bytes))
- sys.exit(-1)
- time.sleep(1)
+ return -1
+ time.sleep(3)
self.outbuf = self.outbuf[n:]
if self.state == self.CONNECTING_THROUGH_PROXY:
return 1 # Keep us around.
diff --git a/networks/hs-min b/networks/hs-min
index e7b7403..73873a8 100644
--- a/networks/hs-min
+++ b/networks/hs-min
@@ -11,7 +11,9 @@ HS = Node(tag="h", hs=1, torrc="hs.tmpl")
# connections:
# a minimum path length of 3, plus the client-nominated rendezvous point,
# plus a seperate introduction point
-NODES = Authority.getN(3) + NonExitRelay.getN(2) + \
+# But we use 6 HSDirs: when the hidden service is not up, the client fails to
+# find the descriptor at the first 3-5 HSDirs
+NODES = Authority.getN(3) + NonExitRelay.getN(3) + \
Client.getN(1) + HS.getN(1)
ConfigureNodes(NODES)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits