Skip to content
Snippets Groups Projects
Commit d186fcd4 authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Remove property "running" from proxy-pair

We don't need it, and already have a function webrtcIsReady that tells
us what we need to know (whether a datachannel was opened before the
timeout period).
parent 9b470fbe
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,6 @@ class ProxyPair {
if (!this.active) {
return;
}
this.running = true;
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.
......@@ -191,7 +190,6 @@ class ProxyPair {
this.relay = null;
this.onCleanup();
this.active = false;
this.running = false;
}
flush() {
......@@ -255,8 +253,6 @@ ProxyPair.prototype.relay = null; // websocket
ProxyPair.prototype.timer = 0;
ProxyPair.prototype.running = false; // Whether a datachannel is opened
ProxyPair.prototype.active = false; // Whether serving a client.
ProxyPair.prototype.flush_timeout_id = null;
......
......@@ -78,7 +78,7 @@ class Snowflake {
}
//set a timeout for channel creation
return setTimeout((() => {
if (!pair.running) {
if (!pair.webrtcIsReady()) {
log('proxypair datachannel timed out waiting for open');
pair.close();
return pair.active = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment