remove json parser from core

pull/720/merge
Darien Raymond 2017-11-19 21:44:49 +01:00
parent afacee9e05
commit ee8d2ebfa9
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 1 additions and 4 deletions

View File

@ -6,9 +6,7 @@ import (
"os/exec" "os/exec"
"v2ray.com/core" "v2ray.com/core"
"v2ray.com/core/app/log"
"v2ray.com/core/common/platform" "v2ray.com/core/common/platform"
jsonconf "v2ray.com/ext/tools/conf/serial"
) )
func jsonToProto(input io.Reader) (*core.Config, error) { func jsonToProto(input io.Reader) (*core.Config, error) {
@ -42,8 +40,7 @@ func init() {
core.RegisterConfigLoader(core.ConfigFormat_JSON, func(input io.Reader) (*core.Config, error) { core.RegisterConfigLoader(core.ConfigFormat_JSON, func(input io.Reader) (*core.Config, error) {
config, err := jsonToProto(input) config, err := jsonToProto(input)
if err != nil { if err != nil {
log.Trace(newError("failed to execute v2ctl to convert config file.").Base(err).AtWarning()) return nil, newError("failed to execute v2ctl to convert config file.").Base(err)
return jsonconf.LoadJSONConfig(input)
} }
return config, nil return config, nil
}) })