From 90f85a727277c2092f6d6dfc3aff1a6918ce2659 Mon Sep 17 00:00:00 2001 From: V2Ray Date: Wed, 7 Oct 2015 13:37:40 +0200 Subject: [PATCH] Fix a bug in transport --- common/net/transport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/net/transport.go b/common/net/transport.go index ae5d7295..eaf44e5f 100644 --- a/common/net/transport.go +++ b/common/net/transport.go @@ -12,7 +12,7 @@ func ReadFrom(reader io.Reader) ([]byte, error) { buffer := make([]byte, bufferSize) nBytes, err := reader.Read(buffer) if nBytes == 0 { - buffer = nil + return nil, err } return buffer[:nBytes], err }