commit 1d2df3cd719cc6074880ed7f6a39f9eae535dee1 Author: Cecylia Bocovich cohosh@torproject.org Date: Tue Apr 28 12:55:58 2020 -0400
Update calls to session description utils in proxy --- proxy/snowflake.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/proxy/snowflake.go b/proxy/snowflake.go index 422cf7e..4877e6f 100644 --- a/proxy/snowflake.go +++ b/proxy/snowflake.go @@ -200,7 +200,13 @@ func (b *Broker) pollOffer(sid string) *webrtc.SessionDescription { return nil } if offer != "" { - return util.DeserializeSessionDescription(offer) + offer, err := util.DeserializeSessionDescription(offer) + if err != nil { + log.Printf("Error processing session description: %s", err.Error()) + return nil + } + return offer + } } } @@ -217,7 +223,10 @@ func (b *Broker) sendAnswer(sid string, pc *webrtc.PeerConnection) error { SDP: util.StripLocalAddresses(ld.SDP), } } - answer := string([]byte(util.SerializeSessionDescription(ld))) + answer, err := util.SerializeSessionDescription(ld) + if err != nil { + return err + } body, err := messages.EncodeAnswerRequest(answer, sid) if err != nil { return err
tor-commits@lists.torproject.org