Skip to content

Commit

Permalink
Do not set read timeout if timeout config is 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed Dec 16, 2012
1 parent d9e55b3 commit b3a5269
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shadowsocks/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import (
)

func SetReadTimeout(c net.Conn) {
c.SetReadDeadline(time.Now().Add(readTimeout))
if readTimeout != 0 {
c.SetReadDeadline(time.Now().Add(readTimeout))
}
}

func Pipe(src, dst net.Conn, end chan byte) {
Expand Down

0 comments on commit b3a5269

Please sign in to comment.