mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Move establishDataChannel to after exchangeSDP.
This commit is contained in:
parent
85277274fd
commit
e8c41650ae
1 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue