mirror of https://github.com/v2ray/v2ray-core
read entire small payload
parent
e4acfe7f7e
commit
2c259165ff
|
@ -66,6 +66,13 @@ func (this *AuthChunkReader) Read() (*alloc.Buffer, error) {
|
||||||
this.chunkLength = int(length) - 4
|
this.chunkLength = int(length) - 4
|
||||||
this.validator = NewValidator(serial.BytesToUint32(buffer.Value[2:6]))
|
this.validator = NewValidator(serial.BytesToUint32(buffer.Value[2:6]))
|
||||||
buffer.SliceFrom(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 {
|
} else if buffer.Len() < this.chunkLength {
|
||||||
_, err := buffer.FillFrom(this.reader)
|
_, err := buffer.FillFrom(this.reader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue