Update packet.go

pull/4926/head
xqzr 2025-07-24 05:18:54 +08:00 committed by GitHub
parent defe743b23
commit b6a6d80cff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 6 deletions

View File

@ -37,11 +37,9 @@ func (w *PacketConnWrapper) ReadPacket(buffer *B.Buffer) (M.Socksaddr, error) {
} else {
buffer.Write(bb.Bytes())
w.cached = mb
var destination net.Destination
var destination net.Destination = w.Dest
if bb.UDP != nil {
destination = *bb.UDP
} else {
destination = w.Dest
}
bb.Release()
return ToSocksaddr(destination), nil
@ -57,11 +55,9 @@ func (w *PacketConnWrapper) ReadPacket(buffer *B.Buffer) (M.Socksaddr, error) {
} else {
buffer.Write(bb.Bytes())
w.cached = nb
var destination net.Destination
var destination net.Destination = w.Dest
if bb.UDP != nil {
destination = *bb.UDP
} else {
destination = w.Dest
}
bb.Release()
return ToSocksaddr(destination), nil