mirror of
https://github.com/SagerNet/sing-shadowsocks.git
synced 2025-04-06 05:17:40 +03:00
Minimal dependencies & Fixes
This commit is contained in:
parent
48809b0a99
commit
fa7811b49c
13 changed files with 237 additions and 191 deletions
|
@ -319,7 +319,7 @@ func (c *clientPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
b := buf.With(p[:n])
|
||||
b := buf.As(p[:n])
|
||||
err = c.DecodePacket(b)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -337,6 +337,7 @@ func (c *clientPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error) {
|
|||
_buffer := buf.StackNew()
|
||||
defer runtime.KeepAlive(_buffer)
|
||||
buffer := common.Dup(_buffer)
|
||||
buffer.WriteRandom(c.keySaltLength)
|
||||
err = M.SocksaddrSerializer.WriteAddrPort(buffer, M.SocksaddrFromNet(addr))
|
||||
if err != nil {
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue