1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-19 02:46:33 -05:00

Workaround for muti-json's hard coded override method (#409)

* Simple workaround for muti-json unable to automatically understand new config options.

* Update jsonem.go
This commit is contained in:
Xiaokang Wang 2020-11-20 18:50:46 +00:00 committed by GitHub
parent f96fe0b35d
commit 61112d8af7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,12 +19,18 @@ func init() {
switch v := input.(type) {
case cmdarg.Arg:
cf := &conf.Config{}
for _, arg := range v {
for i, arg := range v {
newError("Reading config: ", arg).AtInfo().WriteToLog()
r, err := confloader.LoadConfig(arg)
common.Must(err)
c, err := serial.DecodeJSONConfig(r)
common.Must(err)
if i == 0 {
// This ensure even if the muti-json parser do not support a setting,
// It is still respected automatically for the first configure file
*cf = *c
continue
}
cf.Override(c, arg)
}
return cf.Build()