Fix to check running status before closing proxy

This fixes a bug reported in #31385. There was an error with the proxy
deadlock fix in #31100 where we close proxies regardless of connection
status.
This commit is contained in:
Cecylia Bocovich 2019-08-23 15:45:18 -04:00
parent 6be7bedd06
commit 8a5941daab

View file

@ -78,11 +78,13 @@ class Snowflake {
if (!this.receiveOffer(pair, desc)) {
return pair.active = false;
}
//set a timeout for channel creation
//set a timeout for channel creation
return setTimeout((() => {
log('proxypair datachannel timed out waiting for open');
pair.close();
return pair.active = false;
if (!pair.running) {
log('proxypair datachannel timed out waiting for open');
pair.close();
return pair.active = false;
}
}), 20000); // 20 second timeout
} else {
return pair.active = false;