Refine geosite

This commit is contained in:
世界 2022-04-15 19:30:31 +08:00
parent 5991cfc072
commit 12408d60a0
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
27 changed files with 739 additions and 263 deletions

View file

@ -258,13 +258,18 @@ func NewLocalClient(f *flags) (*LocalClient, error) {
return nil, E.Cause(err, "geosite.dat not found")
}
geositeMatcher, err := geosite.LoadGeositeMatcher(geodata, f.Bypass)
site, err := geosite.ReadArray(geodata, f.Bypass)
if err != nil {
return nil, err
}
geositeMatcher, err := geosite.NewMatcher(site)
if err != nil {
return nil, err
}
client.Matcher = geositeMatcher
debug.FreeOSMemory()
}
debug.FreeOSMemory()
return client, nil
}