mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
Transport buffer even when there is an error
This commit is contained in:
+3
-1
@@ -14,10 +14,12 @@ func ReaderToChan(stream chan<- []byte, reader io.Reader) error {
|
||||
for {
|
||||
buffer := make([]byte, bufferSize)
|
||||
nBytes, err := reader.Read(buffer)
|
||||
if nBytes > 0 {
|
||||
stream <- buffer[:nBytes]
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
stream <- buffer[:nBytes]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user