mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
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:
parent
f74da6e0fc
commit
b9138d0c7e
1 changed files with 8 additions and 0 deletions
|
@ -184,6 +184,10 @@ class ProxyPair {
|
||||||
this.client.close();
|
this.client.close();
|
||||||
}
|
}
|
||||||
this.client = null;
|
this.client = null;
|
||||||
|
if (this.peerConnOpen()) {
|
||||||
|
this.pc.close();
|
||||||
|
}
|
||||||
|
this.pc = null;
|
||||||
if (this.relayIsReady()) {
|
if (this.relayIsReady()) {
|
||||||
this.relay.close();
|
this.relay.close();
|
||||||
}
|
}
|
||||||
|
@ -238,6 +242,10 @@ class ProxyPair {
|
||||||
return void 0 === ws || WebSocket.CLOSED === ws.readyState;
|
return void 0 === ws || WebSocket.CLOSED === ws.readyState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
peerConnOpen() {
|
||||||
|
return (null !== this.pc) && ('closed' !== this.pc.connectionState);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyPair.prototype.MAX_BUFFER = 10 * 1024 * 1024;
|
ProxyPair.prototype.MAX_BUFFER = 10 * 1024 * 1024;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue