mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Remove "active" property of proxyPairs
Use their existence in the proxy pair list to indicate they are active.
This commit is contained in:
parent
d186fcd401
commit
789285e0df
2 changed files with 25 additions and 42 deletions
|
@ -85,9 +85,6 @@ class ProxyPair {
|
|||
prepareDataChannel(channel) {
|
||||
channel.onopen = () => {
|
||||
log('WebRTC DataChannel opened!');
|
||||
if (!this.active) {
|
||||
return;
|
||||
}
|
||||
snowflake.ui.setActive(true);
|
||||
// This is the point when the WebRTC datachannel is done, so the next step
|
||||
// is to establish websocket to the server.
|
||||
|
@ -179,17 +176,13 @@ class ProxyPair {
|
|||
if (this.webrtcIsReady()) {
|
||||
this.client.close();
|
||||
}
|
||||
this.client = null;
|
||||
if (this.peerConnOpen()) {
|
||||
this.pc.close();
|
||||
}
|
||||
this.pc = null;
|
||||
if (this.relayIsReady()) {
|
||||
this.relay.close();
|
||||
}
|
||||
this.relay = null;
|
||||
this.onCleanup();
|
||||
this.active = false;
|
||||
}
|
||||
|
||||
flush() {
|
||||
|
@ -253,8 +246,6 @@ ProxyPair.prototype.relay = null; // websocket
|
|||
|
||||
ProxyPair.prototype.timer = 0;
|
||||
|
||||
ProxyPair.prototype.active = false; // Whether serving a client.
|
||||
|
||||
ProxyPair.prototype.flush_timeout_id = null;
|
||||
|
||||
ProxyPair.prototype.onCleanup = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue