From 7acaef1152f5df208d11d8de16687dff3dd334c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Wed, 10 Jul 2024 16:51:38 +0200 Subject: [PATCH] Try to fix wgproxy reference --- client/internal/peer/conn.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/internal/peer/conn.go b/client/internal/peer/conn.go index 759b9e999..a543e1161 100644 --- a/client/internal/peer/conn.go +++ b/client/internal/peer/conn.go @@ -375,9 +375,13 @@ func (conn *Conn) iCEConnectionIsReady(priority ConnPriority, iceConnInfo ICECon if iceConnInfo.RelayedOnLocal { conn.log.Debugf("setup ice turn connection") wgProxy = conn.wgProxyFactory.GetProxy(conn.ctx) - ep, err := conn.wgProxyICE.AddTurnConn(iceConnInfo.RemoteConn) + ep, err := wgProxy.AddTurnConn(iceConnInfo.RemoteConn) if err != nil { conn.log.Errorf("failed to add turn net.Conn to local proxy: %v", err) + err = wgProxy.CloseConn() + if err != nil { + conn.log.Warnf("failed to close turn proxy connection: %v", err) + } return } endpoint = ep