fix: StreamGunWithConn not synchronously close the incoming net.Conn

This commit is contained in:
wwqgtxx
2025-04-03 23:41:24 +08:00
parent 622d99d000
commit 7de24e26b4
6 changed files with 42 additions and 23 deletions

View File

@@ -281,7 +281,7 @@ func newPacketConn(pc net.PacketConn, a C.ProxyAdapter) C.PacketConn {
epc := N.NewEnhancePacketConn(pc)
if _, ok := pc.(syscall.Conn); !ok { // exclusion system conn like *net.UDPConn
epc = N.NewDeadlineEnhancePacketConn(epc) // most conn from outbound can't handle readDeadline correctly
epc = N.NewRefPacketConn(epc, a) // add ref for autoCloseProxyAdapter
epc = N.NewRefPacketConn(epc, a) // add ref for autoCloseProxyAdapter
}
return &packetConn{epc, []string{a.Name()}, a.Name(), utils.NewUUIDV4().String(), parseRemoteDestination(a.Addr())}
}