[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [snowflake/master] fix proxy createAnswer error handling for updated WebRTC syntax
commit 6a8c88fe642cbb57052cac4c60b711f79a30692a
Author: Serene Han <keroserene+git@xxxxxxxxx>
Date: Mon May 2 11:10:45 2016 -0700
fix proxy createAnswer error handling for updated WebRTC syntax
---
proxy/shims.coffee | 5 +++--
proxy/snowflake.coffee | 4 +++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/proxy/shims.coffee b/proxy/shims.coffee
index ef5fbb5..f2f8fb9 100644
--- a/proxy/shims.coffee
+++ b/proxy/shims.coffee
@@ -9,12 +9,13 @@ else
prop = Modernizr.prefixed 'RTCPeerConnection', window, false
if not prop
console.log 'webrtc feature not detected. shutting down'
- return;
+ return
PeerConnection = window[prop]
### FIXME: push these upstream ###
IceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate
- SessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription
+ SessionDescription = window.RTCSessionDescription ||
+ window.mozRTCSessionDescription
location = if window.location then window.location.search.substr(1) else ""
diff --git a/proxy/snowflake.coffee b/proxy/snowflake.coffee
index f325d90..c16694c 100644
--- a/proxy/snowflake.coffee
+++ b/proxy/snowflake.coffee
@@ -134,7 +134,9 @@ class Snowflake
next = (sdp) ->
dbg 'webrtc: Answer ready.'
pair.pc.setLocalDescription sdp
- promise = pair.pc.createAnswer next
+ fail = ->
+ dbg 'webrtc: Failed to create Answer'
+ promise = pair.pc.createAnswer next, fail
promise.then next if promise
makeProxyPair: (relay) ->
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits