mirror of
https://github.com/SagerNet/sing-shadowsocks.git
synced 2025-04-04 12:27:39 +03:00
Fix create padding
This commit is contained in:
parent
52a7f9f469
commit
182b7837c8
1 changed files with 1 additions and 1 deletions
|
@ -266,7 +266,7 @@ func (c *clientConn) writeRequest(payload []byte) error {
|
|||
common.Must(binary.Write(fixedLengthBuffer, binary.BigEndian, uint64(time.Now().Unix())))
|
||||
var paddingLen int
|
||||
if len(payload) == 0 {
|
||||
paddingLen = mRand.Intn(MaxPaddingLength + 1)
|
||||
paddingLen = mRand.Intn(MaxPaddingLength) + 1
|
||||
}
|
||||
variableLengthHeaderLen := M.SocksaddrSerializer.AddrPortLen(c.destination) + 2 + paddingLen + len(payload)
|
||||
common.Must(binary.Write(fixedLengthBuffer, binary.BigEndian, uint16(variableLengthHeaderLen)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue