1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 09:50:43 +00:00

fix CountryCode not set

This commit is contained in:
Shelikhoo 2021-09-07 11:09:34 +01:00
parent 68f28b1913
commit 5182727054
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
2 changed files with 7 additions and 3 deletions

View File

@ -337,6 +337,8 @@ func init() {
filepath := "geoip.dat"
if geo.FilePath != "" {
filepath = geo.FilePath
} else {
geo.CountryCode = geo.Code
}
var err error
geo.Cidr, err = geoLoader.LoadIP(filepath, geo.Code)

View File

@ -151,7 +151,7 @@ func init() {
}))
common.Must(common.RegisterConfig((*SimplifiedConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
ctx = cfgcommon.NewConfigureLoadingContext(context.Background())
ctx = cfgcommon.NewConfigureLoadingContext(ctx)
geoloadername := platform.NewEnvFlag("v2ray.conf.geoloader").GetValue(func() string {
return "standard"
@ -174,6 +174,8 @@ func init() {
filepath := "geoip.dat"
if geo.FilePath != "" {
filepath = geo.FilePath
} else {
geo.CountryCode = geo.Code
}
var err error
geo.Cidr, err = geoLoader.LoadIP(filepath, geo.Code)
@ -184,7 +186,7 @@ func init() {
}
for _, geo := range v.GeoDomain {
if geo.Code != "" {
filepath := "geodomain.dat"
filepath := "geosite.dat"
if geo.FilePath != "" {
filepath = geo.FilePath
}
@ -198,7 +200,7 @@ func init() {
}
}
fullConfig := Config{
fullConfig := &Config{
DomainStrategy: simplifiedConfig.DomainStrategy,
Rule: simplifiedConfig.Rule,
BalancingRule: simplifiedConfig.BalancingRule,