mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
read entire small payload
This commit is contained in:
parent
e4acfe7f7e
commit
2c259165ff
@ -66,6 +66,13 @@ func (this *AuthChunkReader) Read() (*alloc.Buffer, error) {
|
||||
this.chunkLength = int(length) - 4
|
||||
this.validator = NewValidator(serial.BytesToUint32(buffer.Value[2:6]))
|
||||
buffer.SliceFrom(6)
|
||||
if buffer.Len() < this.chunkLength && this.chunkLength <= 2048 {
|
||||
_, err := buffer.FillFrom(this.reader)
|
||||
if err != nil {
|
||||
buffer.Release()
|
||||
return nil, io.ErrUnexpectedEOF
|
||||
}
|
||||
}
|
||||
} else if buffer.Len() < this.chunkLength {
|
||||
_, err := buffer.FillFrom(this.reader)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user