Use io.ReadFull to read socks ver/method selection reply.

This commit is contained in:
Chen Yufei
2013-06-11 23:14:49 +08:00
parent 0a6ea81400
commit 58395a4348

View File

@@ -201,7 +201,7 @@ func (sp socksParent) connect(url *URL) (cn conn, err error) {
// version/method selection
repBuf := make([]byte, 2)
_, err = c.Read(repBuf)
_, err = io.ReadFull(c, repBuf)
if err != nil {
errl.Printf("read ver/method selection error %v\n", err)
hasErr = true