mirror of
https://github.com/SagerNet/sing-shadowsocks.git
synced 2025-04-06 05:17:40 +03:00
Fix WriteAddrPort usage
This commit is contained in:
parent
a446ff2f57
commit
126234728c
2 changed files with 8 additions and 2 deletions
shadowaead
|
@ -232,7 +232,10 @@ func (c *clientPacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksad
|
|||
defer buffer.Release()
|
||||
header := buf.With(buffer.ExtendHeader(c.keySaltLength + M.SocksaddrSerializer.AddrPortLen(destination)))
|
||||
header.WriteRandom(c.keySaltLength)
|
||||
common.Must(M.SocksaddrSerializer.WriteAddrPort(header, destination))
|
||||
err := M.SocksaddrSerializer.WriteAddrPort(header, destination)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
key := buf.NewSize(c.keySaltLength)
|
||||
Kdf(c.key, buffer.To(c.keySaltLength), key)
|
||||
writeCipher, err := c.constructor(key.Bytes())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue