Преглед изворни кода

no op when new timeout setting is the same as previous

v2ray пре 9 година
родитељ
комит
c74091453c
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      common/net/timed_io.go

+ 3 - 0
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{