From 6c6b0b39c9dc553cfda510ad4ef5e17d804a11b2 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Tue, 27 Oct 2020 18:21:25 +0100 Subject: [PATCH] Copy id list in setRequested. Probably not necessary, but I'm supersticious. --- rtpconn/webclient.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rtpconn/webclient.go b/rtpconn/webclient.go index b0bc5cb..bf886dd 100644 --- a/rtpconn/webclient.go +++ b/rtpconn/webclient.go @@ -534,7 +534,11 @@ func gotICE(c *webClient, candidate *webrtc.ICECandidateInit, id string) error { func (c *webClient) setRequested(requested map[string]uint32) error { if c.down != nil { + down := make([]string, 0, len(c.down)) for id := range c.down { + down = append(down, id) + } + for _, id := range down { c.write(clientMessage{ Type: "close", Id: id,