[tor-commits] [snowflake/master] Fix to check running status before closing proxy

cohosh at torproject.org cohosh at torproject.org
Mon Aug 26 13:15:52 UTC 2019


commit 8a5941daab398cd7595c5fdfdae4afb2acc271a9
Author: Cecylia Bocovich <cohosh at torproject.org>
Date:   Fri Aug 23 15:45:18 2019 -0400

    Fix to check running status before closing proxy
    
    This fixes a bug reported in #31385. There was an error with the proxy
    deadlock fix in #31100 where we close proxies regardless of connection
    status.
---
 proxy/snowflake.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/proxy/snowflake.js b/proxy/snowflake.js
index 7a242db..0edb42c 100644
--- a/proxy/snowflake.js
+++ b/proxy/snowflake.js
@@ -78,11 +78,13 @@ class Snowflake {
         if (!this.receiveOffer(pair, desc)) {
           return pair.active = false;
         }
-        //set a timeout for channel creation 
+        //set a timeout for channel creation
         return setTimeout((() => {
-          log('proxypair datachannel timed out waiting for open');
-          pair.close();
-          return pair.active = false;
+          if (!pair.running) {
+            log('proxypair datachannel timed out waiting for open');
+            pair.close();
+            return pair.active = false;
+          }
         }), 20000); // 20 second timeout
       } else {
         return pair.active = false;





More information about the tor-commits mailing list