mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Removed "janky" snowflake state machine
The only place it was used was in window.onpageunload, and we have a better way of determining if the proxy is active there (through the ui). I also removed that code from the webextension since the proxy won't stop running unless you close the browser and after testing it looks like that code doesn't notify the user anyway.
This commit is contained in:
parent
338f1792b8
commit
9b470fbe4b
6 changed files with 11 additions and 36 deletions
|
@ -22,7 +22,6 @@ class Snowflake {
|
|||
this.config = config;
|
||||
this.ui = ui;
|
||||
this.broker = broker;
|
||||
this.state = Snowflake.MODE.INIT;
|
||||
this.proxyPairs = [];
|
||||
if (void 0 === this.config.rateLimitBytes) {
|
||||
this.rateLimit = new DummyRateLimit();
|
||||
|
@ -44,7 +43,6 @@ class Snowflake {
|
|||
// Initialize WebRTC PeerConnection, which requires beginning the signalling
|
||||
// process. |pollBroker| automatically arranges signalling.
|
||||
beginWebRTC() {
|
||||
this.state = Snowflake.MODE.WEBRTC_CONNECTING;
|
||||
log('ProxyPair Slots: ' + this.proxyPairs.length);
|
||||
log('Snowflake IDs: ' + (this.proxyPairs.map(function(p) {
|
||||
return p.id;
|
||||
|
@ -173,13 +171,6 @@ Snowflake.prototype.pollInterval = null;
|
|||
|
||||
Snowflake.prototype.retries = 0;
|
||||
|
||||
// Janky state machine
|
||||
Snowflake.MODE = {
|
||||
INIT: 0,
|
||||
WEBRTC_CONNECTING: 1,
|
||||
WEBRTC_READY: 2
|
||||
};
|
||||
|
||||
Snowflake.MESSAGE = {
|
||||
CONFIRMATION: 'You\'re currently serving a Tor user via Snowflake.'
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue