[tor-commits] [pluggable-transports/snowflake-webext] 05/06: refactor: rename a var

gitolite role git at cupani.torproject.org
Thu Nov 10 15:23:21 UTC 2022


This is an automated email from the git hooks/post-receive script.

cohosh pushed a commit to branch main
in repository pluggable-transports/snowflake-webext.

commit 64c66d2b8016b5a1f66e5568f777183ddbb13d53
Author: WofWca <wofwca at protonmail.com>
AuthorDate: Wed Nov 9 12:13:42 2022 +0400

    refactor: rename a var
---
 proxypair.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/proxypair.js b/proxypair.js
index 5d97274..7658168 100644
--- a/proxypair.js
+++ b/proxypair.js
@@ -30,7 +30,7 @@ class ProxyPair {
     this.id = Util.genSnowflakeID();
     this.c2rSchedule = [];
     this.r2cSchedule = [];
-    this.counted = false;
+    this.nowConnected = false;
   }
 
   /** Prepare a WebRTC PeerConnection and await for an SDP offer. */
@@ -117,7 +117,7 @@ class ProxyPair {
     channel.onopen = () => {
       log('WebRTC DataChannel opened!');
       snowflake.ui.increaseClients();
-      this.counted = true;
+      this.nowConnected = true;
 
       // if we don't receive any keep-alive messages from the client, close the
       // connection
@@ -139,9 +139,9 @@ class ProxyPair {
     channel.onclose = () => {
       log('WebRTC DataChannel closed.');
       snowflake.ui.setStatus('disconnected by webrtc.');
-      if (this.counted) {
+      if (this.nowConnected) {
         snowflake.ui.decreaseClients();
-        this.counted = false;
+        this.nowConnected = false;
       }
       this.flush();
       this.close();
@@ -182,9 +182,9 @@ class ProxyPair {
     relay.onclose = () => {
       log(relay.label + ' closed.');
       snowflake.ui.setStatus('disconnected.');
-      if (this.counted) {
+      if (this.nowConnected) {
         snowflake.ui.decreaseClients();
-        this.counted = false;
+        this.nowConnected = false;
       }
       this.flush();
       this.close();

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list