1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-30 05:55:20 -05:00

fix error detection for pipeline

This commit is contained in:
Darien Raymond
2018-04-13 11:25:41 +02:00
parent ccafce3c9b
commit 48e825567a
3 changed files with 26 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ package buf
import (
"io"
"net"
"os"
"v2ray.com/core/common"
"v2ray.com/core/common/errors"
@@ -22,7 +23,7 @@ func ReadAllToMultiBuffer(reader io.Reader) (MultiBuffer, error) {
mb.Append(b)
}
if err != nil {
if errors.Cause(err) == io.EOF {
if errors.Cause(err) == io.EOF || errors.Cause(err) == os.ErrClosed {
return mb, nil
}
mb.Release()