GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 0c2ab258 authored by Arlo Breault's avatar Arlo Breault

Handle onicecandidate firing after connection closed

This might just be an issue with node-webrtc but seems a harmless
workaround.

Trac: 34126
parent 5aa14972
......@@ -46,11 +46,11 @@ class ProxyPair {
});
this.pc.onicecandidate = (evt) => {
// Browser sends a null candidate once the ICE gathering completes.
if (null === evt.candidate) {
if (null === evt.candidate && this.pc.connectionState !== 'closed') {
// TODO: Use a promise.all to tell Snowflake about all offers at once,
// once multiple proxypairs are supported.
dbg('Finished gathering ICE candidates.');
return snowflake.broker.sendAnswer(this.id, this.pc.localDescription);
snowflake.broker.sendAnswer(this.id, this.pc.localDescription);
}
};
// OnDataChannel triggered remotely from the client when connection succeeds.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment