chore: optimize code
Build / Build (push) Has been cancelled

This commit is contained in:
nadoo committed 2026-11-16 21:08:27 +08:00
1 parent 9eadb8d9f4
commit a7d0421c93
15 files changed
+422 -171

No files matched your search

+5 -3
View File
@@ -201,9 +201,11 @@ func (c *Conn) Request(cmd CmdType) error {
buf.WriteByte(byte(cmd)) // cmd
// target
binary.Write(buf, binary.BigEndian, uint16(c.port)) // port
buf.WriteByte(byte(c.atyp)) // atyp
buf.Write(c.addr) // addr
var port [2]byte
binary.BigEndian.PutUint16(port[:], uint16(c.port))
buf.Write(port[:])
buf.WriteByte(byte(c.atyp)) // atyp
buf.Write(c.addr) // addr
// padding
if paddingLen > 0 {