Ver Fonte

no op when new timeout setting is the same as previous

v2ray há 9 anos atrás
pai
commit
c74091453c
1 ficheiros alterados com 3 adições e 0 exclusões
  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{