mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Reuse proxypair if sendAnswer fails
Make sure to set proxypair.active to false if createAnswer or setLocalDescription fails. This should prevent one edge case the results in an infinite loop described in ticket #31100.
This commit is contained in:
parent
990047b2f5
commit
6cc944f2b4
1 changed files with 3 additions and 2 deletions
|
@ -120,10 +120,11 @@ class Snowflake {
|
|||
var fail, next;
|
||||
next = function(sdp) {
|
||||
dbg('webrtc: Answer ready.');
|
||||
return pair.pc.setLocalDescription(sdp);
|
||||
return pair.pc.setLocalDescription(sdp).catch(fail);
|
||||
};
|
||||
fail = function() {
|
||||
return dbg('webrtc: Failed to create Answer');
|
||||
pair.active = false
|
||||
return dbg('webrtc: Failed to create or set Answer');
|
||||
};
|
||||
return pair.pc.createAnswer().then(next).catch(fail);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue