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 e8c41650 authored by David Fifield's avatar David Fifield

Move establishDataChannel to after exchangeSDP.

parent 85277274
......@@ -120,11 +120,6 @@ func (c *WebRTCPeer) connect(config *webrtc.Configuration, broker *BrokerChannel
if err != nil {
return err
}
err = c.establishDataChannel()
if err != nil {
// nolint: golint
return errors.New("WebRTC: Could not establish DataChannel")
}
answer := exchangeSDP(broker, c.pc.LocalDescription())
log.Printf("Received Answer.\n")
err = c.pc.SetRemoteDescription(*answer)
......@@ -132,6 +127,11 @@ func (c *WebRTCPeer) connect(config *webrtc.Configuration, broker *BrokerChannel
log.Println("WebRTC: Unable to SetRemoteDescription:", err)
return err
}
err = c.establishDataChannel()
if err != nil {
// nolint: golint
return errors.New("WebRTC: Could not establish DataChannel")
}
go c.checkForStaleness()
return nil
}
......
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