parent
28cc9dc973
commit
56c69cdb79
|
@ -30,13 +30,13 @@ var setts RequestFilteringSettings
|
|||
|
||||
func purgeCaches() {
|
||||
if gctx.safebrowsingCache != nil {
|
||||
gctx.safebrowsingCache.Reset()
|
||||
gctx.safebrowsingCache.Purge()
|
||||
}
|
||||
if gctx.parentalCache != nil {
|
||||
gctx.parentalCache.Reset()
|
||||
gctx.parentalCache.Purge()
|
||||
}
|
||||
if gctx.safeSearchCache != nil {
|
||||
gctx.safeSearchCache.Reset()
|
||||
gctx.safeSearchCache.Purge()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,10 +51,6 @@ func NewForTest(c *Config, filters map[int]string) *Dnsfilter {
|
|||
setts = RequestFilteringSettings{}
|
||||
setts.FilteringEnabled = true
|
||||
if c != nil {
|
||||
c.SafeBrowsingCacheSize = 1024
|
||||
c.SafeSearchCacheSize = 1024
|
||||
c.ParentalCacheSize = 1024
|
||||
|
||||
setts.SafeSearchEnabled = c.SafeSearchEnabled
|
||||
setts.SafeBrowsingEnabled = c.SafeBrowsingEnabled
|
||||
setts.ParentalEnabled = c.ParentalEnabled
|
||||
|
|
|
@ -458,10 +458,6 @@ func createTestServer(t *testing.T) *Server {
|
|||
s.conf.FilteringConfig.SafeBrowsingEnabled = true
|
||||
s.conf.Filters = make([]dnsfilter.Filter, 0)
|
||||
|
||||
s.conf.SafeBrowsingCacheSize = 1024
|
||||
s.conf.SafeSearchCacheSize = 1024
|
||||
s.conf.ParentalCacheSize = 1024
|
||||
|
||||
rules := "||nxdomain.example.org^\n||null.example.org^\n127.0.0.1 host.example.org\n"
|
||||
filter := dnsfilter.Filter{ID: 0, Data: []byte(rules)}
|
||||
s.conf.Filters = append(s.conf.Filters, filter)
|
||||
|
|
Loading…
Reference in New Issue