[Fixed] GEOSITE rule load fail
This commit is contained in:
parent
6a78bca9fb
commit
4795a01a56
1 changed files with 5 additions and 6 deletions
|
@ -543,15 +543,14 @@ func parseRules(cfg *RawConfig, proxies map[string]C.Proxy) ([]C.Rule, map[strin
|
||||||
|
|
||||||
params = trimArr(params)
|
params = trimArr(params)
|
||||||
|
|
||||||
|
if ruleName == "GEOSITE" {
|
||||||
|
if err := initGeoSite(); err != nil {
|
||||||
|
return nil, nil, fmt.Errorf("can't initial GeoSite: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
parsed, parseErr := R.ParseRule(ruleName, payload, target, params)
|
parsed, parseErr := R.ParseRule(ruleName, payload, target, params)
|
||||||
if parseErr != nil {
|
if parseErr != nil {
|
||||||
return nil, nil, fmt.Errorf("rules[%d] [%s] error: %s", idx, line, parseErr.Error())
|
return nil, nil, fmt.Errorf("rules[%d] [%s] error: %s", idx, line, parseErr.Error())
|
||||||
} else {
|
|
||||||
if parsed.RuleType() == C.GEOSITE {
|
|
||||||
if err := initGeoSite(); err != nil {
|
|
||||||
return nil, nil, fmt.Errorf("can't initial GeoSite: %w", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if mode != T.Script {
|
if mode != T.Script {
|
||||||
|
|
Loading…
Reference in a new issue