From 124d0988b266773a0d30dd85c32d6539d3ba6791 Mon Sep 17 00:00:00 2001 From: "rui.zheng" Date: Mon, 11 Sep 2017 10:01:30 +0800 Subject: [PATCH] fix #158, ss: clear timer after obtaining the request --- ss.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ss.go b/ss.go index e66a1d0..3cc702d 100644 --- a/ss.go +++ b/ss.go @@ -172,10 +172,12 @@ func (h *shadowHandler) getRequest(conn net.Conn) (host string, err error) { buf := make([]byte, smallBufferSize) // read till we get possible domain length field - conn.SetReadDeadline(time.Now().Add(30 * time.Second)) + conn.SetReadDeadline(time.Now().Add(ReadTimeout)) if _, err = io.ReadFull(conn, buf[:idType+1]); err != nil { return } + // clear timer + conn.SetReadDeadline(time.Time{}) var reqStart, reqEnd int addrType := buf[idType]