mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-28 06:46:14 -04:00
return correct length in ReadFrom
This commit is contained in:
parent
202ac9bb56
commit
2c82f65189
@ -33,13 +33,13 @@ func (this *BufferedWriter) ReadFrom(reader io.Reader) (int64, error) {
|
|||||||
totalBytes := int64(0)
|
totalBytes := int64(0)
|
||||||
for {
|
for {
|
||||||
nBytes, err := this.buffer.FillFrom(reader)
|
nBytes, err := this.buffer.FillFrom(reader)
|
||||||
|
totalBytes += int64(nBytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
return totalBytes, nil
|
return totalBytes, nil
|
||||||
}
|
}
|
||||||
return totalBytes, err
|
return totalBytes, err
|
||||||
}
|
}
|
||||||
totalBytes += int64(nBytes)
|
|
||||||
this.FlushWithoutLock()
|
this.FlushWithoutLock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user