[tor-commits] [flashproxy/master] Don't let unlinked proxies drop to 0 before asking for more.

dcf at torproject.org dcf at torproject.org
Wed Dec 12 21:14:01 UTC 2012


commit e156a88d17766dfe90bb30a3cbc0ad2667c2474a
Author: David Fifield <david at bamsoftware.com>
Date:   Wed Dec 12 12:56:23 2012 -0800

    Don't let unlinked proxies drop to 0 before asking for more.
    
    We want to avoid stalling when the last proxy drops off.
---
 flashproxy-client |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/flashproxy-client b/flashproxy-client
index 3ce327e..0c58754 100755
--- a/flashproxy-client
+++ b/flashproxy-client
@@ -38,6 +38,10 @@ DEFAULT_LOCAL_PORT_EXTERNAL = 9001
 DEFAULT_REMOTE_PORT = 9000
 DEFAULT_REGISTER_METHODS = ["email", "http"]
 
+# We will re-register if we have fewer than this many waiting proxies. The
+# facilitator may choose to ignore our requests.
+DESIRED_NUMBER_OF_PROXIES = 3
+
 LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
 
 class options(object):
@@ -720,7 +724,7 @@ def registration_thread_func():
         register_condvar.acquire()
         register_condvar.wait()
         register_condvar.release()
-        if not unlinked_remotes:
+        if len(unlinked_remotes) < DESIRED_NUMBER_OF_PROXIES:
             register_one()
 
 def proxy_chunk_local_to_remote(local, remote, data = None):





More information about the tor-commits mailing list