From dfad7c05bd1e6bb657b826d87be69d6ed18a84dc Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Tue, 26 May 2026 10:30:24 +0000 Subject: [PATCH] Update temp_udp_listen.go --- proxy/socks/temp_udp_listen.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/proxy/socks/temp_udp_listen.go b/proxy/socks/temp_udp_listen.go index cdcbf993..84d62733 100644 --- a/proxy/socks/temp_udp_listen.go +++ b/proxy/socks/temp_udp_listen.go @@ -37,14 +37,12 @@ func (c *TempUDPConn) Read(b []byte) (n int, err error) { if err != nil { return } - if c.remote.Load() == nil { + if load := c.remote.Load(); load == nil { if remoteIP, _, _ := net.SplitHostPort(remote.String()); remoteIP == c.ExpectedRemoteIP { - c.remote.CompareAndSwap(nil, &remote) - } else { - continue + c.remote.Store(&remote) + return } - } - if remote.String() == (*c.remote.Load()).String() { + } else if remote.String() == (*load).String() { return } }