Close data channel on offer init errors
This commit is contained in:
parent
3aa2320442
commit
309a900b9a
|
@ -234,6 +234,7 @@ func (tc *TrackerClient) Announce(event tracker.AnnounceEvent, infoHash [20]byte
|
|||
}},
|
||||
})
|
||||
if err != nil {
|
||||
dc.Close()
|
||||
pc.Close()
|
||||
}
|
||||
return err
|
||||
|
|
|
@ -127,12 +127,14 @@ func (tc *TrackerClient) newOffer(
|
|||
|
||||
offer, err = peerConnection.CreateOffer(nil)
|
||||
if err != nil {
|
||||
dataChannel.Close()
|
||||
peerConnection.Close()
|
||||
return
|
||||
}
|
||||
|
||||
offer, err = setAndGatherLocalDescription(peerConnection, offer)
|
||||
if err != nil {
|
||||
dataChannel.Close()
|
||||
peerConnection.Close()
|
||||
}
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue