1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-25 00:45:24 +00:00

return correct length in ReadFrom

This commit is contained in:
v2ray 2016-06-01 22:09:12 +02:00
parent 202ac9bb56
commit 2c82f65189

View File

@ -33,13 +33,13 @@ func (this *BufferedWriter) ReadFrom(reader io.Reader) (int64, error) {
totalBytes := int64(0)
for {
nBytes, err := this.buffer.FillFrom(reader)
totalBytes += int64(nBytes)
if err != nil {
if err == io.EOF {
return totalBytes, nil
}
return totalBytes, err
}
totalBytes += int64(nBytes)
this.FlushWithoutLock()
}
}