mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-05 04:47:40 +03:00
Fix socks udp behavior
This commit is contained in:
parent
1fa58a8663
commit
e29eff15cd
1 changed files with 3 additions and 2 deletions
|
@ -206,12 +206,13 @@ func HandleConnection0(ctx context.Context, conn net.Conn, version byte, authent
|
||||||
metadata.Destination = request.Destination
|
metadata.Destination = request.Destination
|
||||||
var innerError error
|
var innerError error
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
|
associatePacketConn := NewAssociatePacketConn(udpConn, request.Destination, conn)
|
||||||
go func() {
|
go func() {
|
||||||
defer conn.Close()
|
innerError = handler.NewPacketConnection(ctx, associatePacketConn, metadata)
|
||||||
innerError = handler.NewPacketConnection(ctx, NewAssociatePacketConn(udpConn, request.Destination, conn), metadata)
|
|
||||||
close(done)
|
close(done)
|
||||||
}()
|
}()
|
||||||
err = common.Error(io.Copy(io.Discard, conn))
|
err = common.Error(io.Copy(io.Discard, conn))
|
||||||
|
associatePacketConn.Close()
|
||||||
<-done
|
<-done
|
||||||
return E.Errors(innerError, err)
|
return E.Errors(innerError, err)
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue