Browse Source

Transport buffer even when there is an error

pull/11/head
V2Ray 9 years ago
parent
commit
194abb9d6c
  1. 4
      net/transport.go

4
net/transport.go

@ -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…
Cancel
Save