mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 18:17:52 -05:00
Fix: check jsonConfig.KcpConfig
This commit is contained in:
parent
bcf87d1592
commit
de4b4516ee
@ -5,6 +5,7 @@ package transport
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
|
"github.com/v2ray/v2ray-core/common/log"
|
||||||
"github.com/v2ray/v2ray-core/transport/hub/kcpv"
|
"github.com/v2ray/v2ray-core/transport/hub/kcpv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -23,10 +24,16 @@ func (this *Config) UnmarshalJSON(data []byte) error {
|
|||||||
}
|
}
|
||||||
this.ConnectionReuse = jsonConfig.ConnectionReuse
|
this.ConnectionReuse = jsonConfig.ConnectionReuse
|
||||||
this.enableKcp = jsonConfig.EnableKcp
|
this.enableKcp = jsonConfig.EnableKcp
|
||||||
|
if jsonConfig.KcpConfig != nil {
|
||||||
this.kcpConfig = jsonConfig.KcpConfig
|
this.kcpConfig = jsonConfig.KcpConfig
|
||||||
if jsonConfig.KcpConfig.AdvancedConfigs == nil {
|
if jsonConfig.KcpConfig.AdvancedConfigs == nil {
|
||||||
jsonConfig.KcpConfig.AdvancedConfigs = kcpv.DefaultAdvancedConfigs
|
jsonConfig.KcpConfig.AdvancedConfigs = kcpv.DefaultAdvancedConfigs
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if jsonConfig.EnableKcp {
|
||||||
|
log.Error("transport: You have enabled KCP but no configure is given")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user