From 7ee8cbc45a6e31f82c20a7fffc794110ac79593d Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 5 Nov 2020 20:47:13 +0100 Subject: [PATCH] Don't push incomplete connections. If a connetion is slow to get established, this would cause it to be pushed twice, the first time before it is complete. Thanks to Roman Koval who noticed the issue. --- rtpconn/webclient.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rtpconn/webclient.go b/rtpconn/webclient.go index bf886dd..8baf6bd 100644 --- a/rtpconn/webclient.go +++ b/rtpconn/webclient.go @@ -829,6 +829,9 @@ func clientLoop(c *webClient, ws *websocket.Conn) error { }) case pushConnsAction: for _, u := range c.up { + if !u.complete() { + continue + } tracks := u.getTracks() ts := make([]conn.UpTrack, len(tracks)) for i, t := range tracks {