Просмотр исходного кода

no op when new timeout setting is the same as previous

v2ray 9 лет назад
Родитель
Сommit
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{