From 4de29530376a09717ce8f62716650d2dbfdea446 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Wed, 9 Dec 2020 01:05:24 +0100 Subject: [PATCH] Fix incorrect closure in pushConnsAction. This was causing us to lose connections. --- rtpconn/webclient.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtpconn/webclient.go b/rtpconn/webclient.go index 00cb5de..0e1bcdf 100644 --- a/rtpconn/webclient.go +++ b/rtpconn/webclient.go @@ -819,7 +819,7 @@ func clientLoop(c *webClient, ws *websocket.Conn) error { for i, t := range tracks { ts[i] = t } - go func() { + go func(u *rtpUpConnection, ts []conn.UpTrack) { err := a.client.PushConn( g, u.id, u, ts, u.label, ) @@ -829,7 +829,7 @@ func clientLoop(c *webClient, ws *websocket.Conn) error { err, ) } - }() + }(u, ts) } case connectionFailedAction: if down := getDownConn(c, a.id); down != nil {