Remove unused outbound offer answered field

This commit is contained in:
Matt Joiner 2020-04-20 14:00:10 +10:00
parent c074b30d94
commit fb6af2a426
2 changed files with 0 additions and 10 deletions

View File

@ -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

View File

@ -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
}