Make sure we close peer connections in proxy

Not closing peer connections was causing UDP sockets to remain open
indefinitely (as reported in ticket #31285).
This commit is contained in:
Cecylia Bocovich 2019-10-14 18:19:56 -04:00
parent f74da6e0fc
commit b9138d0c7e

View file

@ -184,6 +184,10 @@ class ProxyPair {
this.client.close();
}
this.client = null;
if (this.peerConnOpen()) {
this.pc.close();
}
this.pc = null;
if (this.relayIsReady()) {
this.relay.close();
}
@ -238,6 +242,10 @@ class ProxyPair {
return void 0 === ws || WebSocket.CLOSED === ws.readyState;
}
peerConnOpen() {
return (null !== this.pc) && ('closed' !== this.pc.connectionState);
}
}
ProxyPair.prototype.MAX_BUFFER = 10 * 1024 * 1024;