Don't prevent DNS queries from being answered if the partition is full

This commit is contained in:
Frank Denis 2019-12-09 12:55:26 +01:00
parent 8efbf401c8
commit bfd74185f5
5 changed files with 6 additions and 11 deletions

View File

@ -151,9 +151,7 @@ func (plugin *PluginBlockIP) Eval(pluginsState *PluginsState, msg *dns.Msg) erro
if plugin.logger == nil {
return errors.New("Log file not initialized")
}
if _, err := plugin.logger.Write([]byte(line)); err != nil {
return err
}
_, _ = plugin.logger.Write([]byte(line))
}
}
return nil

View File

@ -66,9 +66,7 @@ func (blockedNames *BlockedNames) check(pluginsState *PluginsState, qName string
if blockedNames.logger == nil {
return false, errors.New("Log file not initialized")
}
if _, err := blockedNames.logger.Write([]byte(line)); err != nil {
return false, err
}
_, _ = blockedNames.logger.Write([]byte(line))
}
return true, nil
}

View File

@ -76,9 +76,7 @@ func (plugin *PluginNxLog) Eval(pluginsState *PluginsState, msg *dns.Msg) error
if plugin.logger == nil {
return errors.New("Log file not initialized")
}
_, _ = plugin.logger.Write([]byte(line))
if _, err := plugin.logger.Write([]byte(line)); err != nil {
return err
}
return nil
}

View File

@ -105,6 +105,7 @@ func (plugin *PluginQueryLog) Eval(pluginsState *PluginsState, msg *dns.Msg) err
if plugin.logger == nil {
return errors.New("Log file not initialized")
}
plugin.logger.Write([]byte(line))
_, _ = plugin.logger.Write([]byte(line))
return nil
}

View File

@ -124,7 +124,7 @@ func (plugin *PluginWhitelistName) Eval(pluginsState *PluginsState, msg *dns.Msg
if plugin.logger == nil {
return errors.New("Log file not initialized")
}
plugin.logger.Write([]byte(line))
_, _ = plugin.logger.Write([]byte(line))
}
}
return nil