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

[tor-commits] [pluggable-transports/snowflake-webext] 11/15: refactor: rename `beginWebRTC` -> `beginServingClients`



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 be8a122f07c99c5189067a3c06e61e3d9f9a0709
Author: WofWca <wofwca@xxxxxxxxxxxxxx>
AuthorDate: Sun Nov 6 13:52:39 2022 +0400

    refactor: rename `beginWebRTC` -> `beginServingClients`
    
    And reword the docstring
---
 README.md              | 2 +-
 init-badge.js          | 2 +-
 init-node.js           | 2 +-
 init-testing.js        | 2 +-
 init-webext.js         | 2 +-
 snowflake.js           | 7 +++----
 spec/snowflake.spec.js | 2 +-
 7 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md
index 96fde7b..418e0c6 100644
--- a/README.md
+++ b/README.md
@@ -198,7 +198,7 @@ var broker = new Broker(config.brokerUrl);
 var snowflake = new Snowflake(config, ui, broker);
 
 snowflake.setRelayAddr(config.relayAddr);
-snowflake.beginWebRTC();
+snowflake.beginServingClients();
 ```
 
 This minimal setup is pretty much what's currently in `init-node.js`.
diff --git a/init-badge.js b/init-badge.js
index a4305a2..0c4c00f 100644
--- a/init-badge.js
+++ b/init-badge.js
@@ -181,7 +181,7 @@ var
         dbg('Contacting Broker at ' + broker.url);
         log('Starting snowflake');
         snowflake.setRelayAddr(config.relayAddr);
-        snowflake.beginWebRTC();
+        snowflake.beginServingClients();
       },
       () => {
         ui.missingFeature('popupBridgeUnreachable');
diff --git a/init-node.js b/init-node.js
index e5c2e32..66c0fa4 100644
--- a/init-node.js
+++ b/init-node.js
@@ -24,4 +24,4 @@ dbg('Contacting Broker at ' + broker.url);
 
 snowflake.setRelayAddr(config.relayAddr);
 
-snowflake.beginWebRTC();
+snowflake.beginServingClients();
diff --git a/init-testing.js b/init-testing.js
index 637c961..235f2b3 100644
--- a/init-testing.js
+++ b/init-testing.js
@@ -118,7 +118,7 @@ var
     // Otherwise, begin setting up WebRTC and acting as a proxy.
     dbg('Contacting Broker at ' + broker.url);
     snowflake.setRelayAddr(config.relayAddr);
-    return snowflake.beginWebRTC();
+    return snowflake.beginServingClients();
   };
 
   // Notification of closing tab with active proxy.
diff --git a/init-webext.js b/init-webext.js
index 3bbdfde..daa8e9a 100644
--- a/init-webext.js
+++ b/init-webext.js
@@ -281,7 +281,7 @@ var
     dbg('Contacting Broker at ' + broker.url);
     log('Starting snowflake');
     snowflake.setRelayAddr(config.relayAddr);
-    snowflake.beginWebRTC();
+    snowflake.beginServingClients();
   };
 
   window.onunload = function() {
diff --git a/snowflake.js b/snowflake.js
index 775fded..ae0a974 100644
--- a/snowflake.js
+++ b/snowflake.js
@@ -49,17 +49,16 @@ class Snowflake {
   }
 
   /**
-   * Initialize WebRTC PeerConnection, which requires beginning the signalling
-   * process. `pollBroker` automatically arranges signalling.
+   * Start asking the broker for clients and serving them.
    */
-  beginWebRTC() {
+  beginServingClients() {
     if (this.proxyPairs.length < this.config.maxNumClients) {
       this.pollBroker();
     } else {
       dbg('Polling skipped: at client capacity.');
     }
     this.pollTimeoutId = setTimeout((() => {
-      this.beginWebRTC();
+      this.beginServingClients();
     }), this.pollInterval);
   }
 
diff --git a/spec/snowflake.spec.js b/spec/snowflake.spec.js
index 54ecb02..bac49d0 100644
--- a/spec/snowflake.spec.js
+++ b/spec/snowflake.spec.js
@@ -69,7 +69,7 @@ describe('Snowflake', function() {
     var s;
     s = new Snowflake(config, ui, new FakeBroker());
     spyOn(s.broker, 'getClientOffer').and.callThrough();
-    s.beginWebRTC();
+    s.beginServingClients();
     expect(s.retries).toBe(1);
     expect(s.broker.getClientOffer).toHaveBeenCalled();
   });

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits