mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-09-15 22:10:26 +00:00
Do not send zero length record
This commit is contained in:
@@ -90,6 +90,17 @@ func (c *fragmentConn) Write(p []byte) (n int, err error) {
|
||||
to = len(data)
|
||||
}
|
||||
l := to - from
|
||||
// if l is 0, don't send empty tls record(will break the connection) but still sleep
|
||||
if l == 0 {
|
||||
if !mergeHello {
|
||||
delayMin, delayMax := c.delayForSegment(int(splitNum))
|
||||
if delayMax > 0 {
|
||||
time.Sleep(time.Duration(crypto.RandBetween(delayMin, delayMax)) * time.Millisecond)
|
||||
}
|
||||
}
|
||||
splitNum++
|
||||
continue
|
||||
}
|
||||
if 5+l > len(buff) {
|
||||
buff = make([]byte, 5+l)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user