From: Matt Joiner Date: Mon, 20 Apr 2020 04:00:10 +0000 (+1000) Subject: Remove unused outbound offer answered field X-Git-Tag: v1.16.0~60 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=fb6af2a426e0a31bfae18efb5dc0c7b905bb9720;p=btrtrc.git Remove unused outbound offer answered field --- diff --git a/webtorrent/tracker_client.go b/webtorrent/tracker_client.go index 13df300b..9644cf19 100644 --- a/webtorrent/tracker_client.go +++ b/webtorrent/tracker_client.go @@ -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 diff --git a/webtorrent/transport.go b/webtorrent/transport.go index 809d2c13..37989b84 100644 --- a/webtorrent/transport.go +++ b/webtorrent/transport.go @@ -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 }