[tor-commits] [snowflake-webext/master] Increment natFailures when snowflake is restricted

cohosh at torproject.org cohosh at torproject.org
Wed Jan 27 17:13:28 UTC 2021


commit 31730750eecb14a2afda5bbf83f21e49357628db
Author: Cecylia Bocovich <cohosh at torproject.org>
Date:   Mon Jan 25 13:33:16 2021 -0500

    Increment natFailures when snowflake is restricted
---
 snowflake.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/snowflake.js b/snowflake.js
index 9ac5fad..7d4edb9 100644
--- a/snowflake.js
+++ b/snowflake.js
@@ -86,9 +86,12 @@ class Snowflake {
           this.pollInterval =
                 Math.min(this.pollInterval + this.config.pollAdjustment,
                   this.config.slowestBrokerPollInterval);
+          if (clientNAT == "restricted") {
+            this.natFailures++;
+          }
           // if we fail to connect to a restricted client 3 times in
           // a row, assume we have a restricted NAT
-          if ((clientNAT == "restricted") && (this.natFailures > 3)){
+          if (this.natFailures >= 3){
             this.ui.natType = "restricted";
             console.log("Learned NAT type: restricted");
             this.natFailures = 0;



More information about the tor-commits mailing list