mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-30 23:37:44 +00:00
more json test cases
This commit is contained in:
1 parent
be57f48bb3
commit
c74bcc9c50
4 files changed
+68
-8
No files matched your search
@@ -95,6 +95,14 @@ func (this *InboundDetourAllocationConfig) UnmarshalJSON(data []byte) error {
|
||||
this.Strategy = jsonConfig.Strategy
|
||||
this.Concurrency = jsonConfig.Concurrency
|
||||
this.Refresh = jsonConfig.RefreshMin
|
||||
if this.Strategy == AllocationStrategyRandom {
|
||||
if this.Refresh == 0 {
|
||||
this.Refresh = 5
|
||||
}
|
||||
if this.Concurrency == 0 {
|
||||
this.Concurrency = 3
|
||||
}
|
||||
}
|
||||
if this.Refresh == 0 {
|
||||
this.Refresh = DefaultRefreshMinute
|
||||
}
|
||||
@@ -128,14 +136,6 @@ func (this *InboundDetourConfig) UnmarshalJSON(data []byte) error {
|
||||
Refresh: DefaultRefreshMinute,
|
||||
}
|
||||
}
|
||||
if this.Allocation.Strategy == AllocationStrategyRandom {
|
||||
if this.Allocation.Refresh == DefaultRefreshMinute {
|
||||
this.Allocation.Refresh = 5
|
||||
}
|
||||
if this.Allocation.Concurrency == 0 {
|
||||
this.Allocation.Concurrency = 3
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user