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

default value for strategy random

v2ray 9 лет назад
Родитель
Сommit
c958a20565
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      shell/point/config_json.go

+ 8 - 0
shell/point/config_json.go

@@ -128,6 +128,14 @@ func (this *InboundDetourConfig) UnmarshalJSON(data []byte) error {
 			Refresh:  DefaultRefreshMinute,
 		}
 	}
+	if this.Allocation.Strategy == AllocationStrategyRandom {
+		if this.Allocation.Refresh == 0 {
+			this.Allocation.Refresh = 5
+		}
+		if this.Allocation.Concurrency == 0 {
+			this.Allocation.Concurrency == 3
+		}
+	}
 	return nil
 }