From c74091453c1a85f47b286dc96ae9c9470bb14243 Mon Sep 17 00:00:00 2001 From: v2ray Date: Mon, 4 Jan 2016 22:01:46 +0100 Subject: [PATCH] no op when new timeout setting is the same as previous --- common/net/timed_io.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/net/timed_io.go b/common/net/timed_io.go index ff245083..4132bd7e 100644 --- a/common/net/timed_io.go +++ b/common/net/timed_io.go @@ -33,6 +33,9 @@ func (reader *TimeOutReader) GetTimeOut() int { } func (reader *TimeOutReader) SetTimeOut(value int) { + if value == reader.timeout { + return + } reader.timeout = value if value > 0 { reader.worker = &timedReaderWorker{