From d7fcd209a49dcd842f98d687f1f4407c2da1d62e Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Tue, 26 Dec 2023 16:26:17 +0100 Subject: [PATCH] updated gcConnOnError func --- src/ws/init.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ws/init.go b/src/ws/init.go index 3dbbfd5..e6993ff 100644 --- a/src/ws/init.go +++ b/src/ws/init.go @@ -44,10 +44,8 @@ func welcomeAgents(ws *websocket.Conn, welcome wsWelcome, t string) { func gcConnOnError(ws *websocket.Conn) (err error) { listeners.Range(func(index, value interface{}) bool { - if value.(*connectionInfo).ConnectionPS == ws { + if value.(*connectionInfo).ConnectionPS == ws || value.(*connectionInfo).ConnectionRR == ws { value.(*connectionInfo).ConnectionPS.Close() - listeners.Delete(index) - } else if value.(*connectionInfo).ConnectionRR == ws { value.(*connectionInfo).ConnectionRR.Close() listeners.Delete(index) }