* use urlfilter v0.4.0

Now we pass filtering rules to urlfilter as filer file names,
 rather than the list of rule strings.
(Note: user rules are still passed as the list of rule strings).

As a result, we don't store the contents of filter files in memory.
This commit is contained in:
Simon Zolin
2019-07-04 14:00:20 +03:00
parent ceac4cbdd5
commit 134d9275bb
6 changed files with 51 additions and 22 deletions

View File

@@ -260,7 +260,11 @@ func (s *Server) initDNSFilter() error {
if s.conf.FilteringEnabled {
filters = make(map[int]string)
for _, f := range s.conf.Filters {
filters[int(f.ID)] = string(f.Data)
if f.ID == 0 {
filters[int(f.ID)] = string(f.Data)
} else {
filters[int(f.ID)] = f.FilePath
}
}
}