Fix WriteAddrPort usage

This commit is contained in:
世界 2023-09-07 09:06:46 +08:00
parent 0eec7bbe19
commit 03c21c0a12
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
5 changed files with 39 additions and 14 deletions

View file

@ -43,7 +43,10 @@ func (v *VectorisedAssociatePacketConn) WriteVectorisedPacket(buffers []*buf.Buf
header := buf.NewSize(3 + M.SocksaddrSerializer.AddrPortLen(destination))
defer header.Release()
common.Must(header.WriteZeroN(3))
common.Must(M.SocksaddrSerializer.WriteAddrPort(header, destination))
err := M.SocksaddrSerializer.WriteAddrPort(header, destination)
if err != nil {
return err
}
return v.VectorisedPacketWriter.WriteVectorisedPacket(append([]*buf.Buffer{header}, buffers...), destination)
}