mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
Transport buffer even when there is an error
This commit is contained in:
parent
919fd5b16b
commit
194abb9d6c
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user