1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-16 09:26:21 -05:00

fix length calculation in bufferToBytesReader.WriteTo

This commit is contained in:
Darien Raymond 2017-11-03 13:19:48 +01:00
parent 10712b3235
commit 2f5d501643

View File

@ -73,10 +73,10 @@ func (r *bufferToBytesReader) writeToInternal(writer io.Writer) (int64, error) {
mbWriter := NewWriter(writer)
totalBytes := int64(0)
if r.leftOver != nil {
totalBytes += int64(r.leftOver.Len())
if err := mbWriter.Write(r.leftOver); err != nil {
return 0, err
}
totalBytes += int64(r.leftOver.Len())
}
for {