mirror of
https://github.com/unitoftime/rtcnet.git
synced 2025-09-27 04:36:08 +08:00
Fixed very minor race condition
This commit is contained in:
3
dial.go
3
dial.go
@@ -172,10 +172,11 @@ func Dial(address string, tlsConfig *tls.Config, ordered bool) (*Conn, error) {
|
||||
printDataChannel(dataChannel)
|
||||
trace("Dial: Data Channel OnOpen")
|
||||
|
||||
conn.raw, err = dataChannel.Detach()
|
||||
detached, err := dataChannel.Detach()
|
||||
if err != nil {
|
||||
conn.pushErrorData(err)
|
||||
} else {
|
||||
conn.raw = detached
|
||||
conn.dataChannel = dataChannel
|
||||
connFinish <- true
|
||||
}
|
||||
|
Reference in New Issue
Block a user