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:
Cecylia Bocovich 2019-07-17 09:22:23 -04:00
parent 990047b2f5
commit 6cc944f2b4

View file

@ -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);
}