[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [flashproxy/master] Remove facilitator poll interval config.



commit 99958c0fd0113764370ed68064f2d2bda257fa25
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Wed Dec 21 02:19:25 2016 -0800

    Remove facilitator poll interval config.
---
 proxy/flashproxy.js | 43 ++++++++++---------------------------------
 1 file changed, 10 insertions(+), 33 deletions(-)

diff --git a/proxy/flashproxy.js b/proxy/flashproxy.js
index 12dd824..0194309 100644
--- a/proxy/flashproxy.js
+++ b/proxy/flashproxy.js
@@ -10,14 +10,6 @@
  * lang=<CODE>
  * Display language of the badge, as an IETF language tag.
  *
- * facilitator_poll_interval=<FLOAT>
- * How often to poll the facilitator, in seconds. The default is
- * DEFAULT_FACILITATOR_POLL_INTERVAL. There is a sanity-check minimum of 1.0 s.
- *
- * initial_facilitator_poll_interval=<FLOAT>
- * How long to wait before polling the facilitator the first time, in seconds.
- * DEFAULT_INITIAL_FACILITATOR_POLL_INTERVAL.
- *
  * max_clients=<NUM>
  * How many clients to serve concurrently. The default is
  * DEFAULT_MAX_NUM_CLIENTS.
@@ -56,8 +48,8 @@ https://trac.torproject.org/projects/tor/ticket/7733 */
 var CONNECTIONS_PER_CLIENT = 2
 var DEFAULT_MAX_NUM_CLIENTS = 10;
 
-var DEFAULT_INITIAL_FACILITATOR_POLL_INTERVAL = 60.0;
-var DEFAULT_FACILITATOR_POLL_INTERVAL = 3600.0;
+var INITIAL_FACILITATOR_POLL_INTERVAL = 60.0;
+var DEFAULT_FACILITATOR_POLL_INTERVAL = 3600.0; // May be overriden by facilitator check-back-in.
 var MIN_FACILITATOR_POLL_INTERVAL = 10.0;
 
 /* Bytes per second. Set to undefined to disable limit. */
@@ -478,19 +470,8 @@ function FlashProxy() {
             return;
         }
 
-        this.initial_facilitator_poll_interval = get_param_timespec(query, "initial_facilitator_poll_interval", DEFAULT_INITIAL_FACILITATOR_POLL_INTERVAL);
-        if (this.initial_facilitator_poll_interval === null || this.initial_facilitator_poll_interval < 0) {
-            puts("Error: initial_facilitator_poll_interval must be a nonnegative number.");
-            this.die();
-            return;
-        }
-
-        this.facilitator_poll_interval = get_param_timespec(query, "facilitator_poll_interval");
-        if (this.facilitator_poll_interval !== undefined && (this.facilitator_poll_interval === null || this.facilitator_poll_interval < MIN_FACILITATOR_POLL_INTERVAL)) {
-            puts("Error: facilitator_poll_interval must be a nonnegative number at least " + MIN_FACILITATOR_POLL_INTERVAL + ".");
-            this.die();
-            return;
-        }
+        this.initial_facilitator_poll_interval = INITIAL_FACILITATOR_POLL_INTERVAL;
+        this.facilitator_poll_interval = DEFAULT_FACILITATOR_POLL_INTERVAL;
 
         if (query["ratelimit"] === "off")
             rate_limit_bytes = undefined;
@@ -568,17 +549,13 @@ function FlashProxy() {
 
         response = parse_query_string(text);
 
-        if (this.facilitator_poll_interval) {
-            poll_interval = this.facilitator_poll_interval;
-        } else {
-            poll_interval = get_param_integer(response, "check-back-in", DEFAULT_FACILITATOR_POLL_INTERVAL);
-            if (poll_interval === null) {
-                puts("Error: can't parse polling interval from facilitator, " + repr(poll_interval) + ".");
-                poll_interval = DEFAULT_FACILITATOR_POLL_INTERVAL;
-            }
-            if (poll_interval < MIN_FACILITATOR_POLL_INTERVAL)
-                poll_interval = MIN_FACILITATOR_POLL_INTERVAL;
+        poll_interval = get_param_integer(response, "check-back-in", DEFAULT_FACILITATOR_POLL_INTERVAL);
+        if (poll_interval === null) {
+            puts("Error: can't parse polling interval from facilitator, " + repr(poll_interval) + ".");
+            poll_interval = DEFAULT_FACILITATOR_POLL_INTERVAL;
         }
+        if (poll_interval < MIN_FACILITATOR_POLL_INTERVAL)
+            poll_interval = MIN_FACILITATOR_POLL_INTERVAL;
 
         puts("Next check in " + repr(poll_interval) + " seconds.");
         setTimeout(this.proxy_main.bind(this), poll_interval * 1000);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits