1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-28 10:15:23 +00:00

format code

This commit is contained in:
V2Ray 2015-10-09 16:48:11 +02:00
parent ab84639aaa
commit 09c76de65f

View File

@ -34,9 +34,9 @@ func ReaderToChan(stream chan<- *alloc.Buffer, reader io.Reader) error {
func ChanToWriter(writer io.Writer, stream <-chan *alloc.Buffer) error {
for buffer := range stream {
nBytes, err := writer.Write(buffer.Value)
if nBytes < buffer.Len() {
_, err = writer.Write(buffer.Value[nBytes:])
}
if nBytes < buffer.Len() {
_, err = writer.Write(buffer.Value[nBytes:])
}
buffer.Release()
if err != nil {
return err