Remove unused outbound offer answered field
This commit is contained in:
parent
c074b30d94
commit
fb6af2a426
|
@ -42,9 +42,6 @@ type outboundOffer struct {
|
|||
originalOffer webrtc.SessionDescription
|
||||
peerConnection wrappedPeerConnection
|
||||
dataChannel *webrtc.DataChannel
|
||||
// Whether we've received an answer for this offer, and closing its PeerConnection has been
|
||||
// handed off.
|
||||
answered bool
|
||||
}
|
||||
|
||||
type DataChannelContext struct {
|
||||
|
@ -86,9 +83,6 @@ func (tc *TrackerClient) Run() error {
|
|||
|
||||
func (tc *TrackerClient) closeUnusedOffers() {
|
||||
for _, offer := range tc.outboundOffers {
|
||||
if offer.answered {
|
||||
continue
|
||||
}
|
||||
offer.peerConnection.Close()
|
||||
}
|
||||
tc.outboundOffers = nil
|
||||
|
|
|
@ -130,10 +130,6 @@ func getAnswerForOffer(
|
|||
func (t *outboundOffer) setAnswer(answer webrtc.SessionDescription, onOpen func(datachannel.ReadWriteCloser)) error {
|
||||
setDataChannelOnOpen(t.dataChannel, t.peerConnection, onOpen)
|
||||
err := t.peerConnection.SetRemoteDescription(answer)
|
||||
if err == nil {
|
||||
// TODO: Maybe grab this inside the onOpen callback and mark the offer used there.
|
||||
t.answered = true
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue