cleanup: plugins: rename error variable as err
Follow go naming tradition.
This commit is contained in:
parent
6ba2ff4fdc
commit
659ff4b19d
|
@ -244,9 +244,9 @@ func (pluginsState *PluginsState) ApplyQueryPlugins(pluginsGlobals *PluginsGloba
|
||||||
pluginsGlobals.RLock()
|
pluginsGlobals.RLock()
|
||||||
defer pluginsGlobals.RUnlock()
|
defer pluginsGlobals.RUnlock()
|
||||||
for _, plugin := range *pluginsGlobals.queryPlugins {
|
for _, plugin := range *pluginsGlobals.queryPlugins {
|
||||||
if ret := plugin.Eval(pluginsState, &msg); ret != nil {
|
if err := plugin.Eval(pluginsState, &msg); err != nil {
|
||||||
pluginsState.action = PluginsActionDrop
|
pluginsState.action = PluginsActionDrop
|
||||||
return packet, ret
|
return packet, err
|
||||||
}
|
}
|
||||||
if pluginsState.action == PluginsActionReject {
|
if pluginsState.action == PluginsActionReject {
|
||||||
synth, err := RefusedResponseFromMessage(&msg, pluginsGlobals.refusedCodeInResponses, pluginsGlobals.respondWithIPv4, pluginsGlobals.respondWithIPv6, pluginsState.cacheMinTTL)
|
synth, err := RefusedResponseFromMessage(&msg, pluginsGlobals.refusedCodeInResponses, pluginsGlobals.respondWithIPv4, pluginsGlobals.respondWithIPv6, pluginsState.cacheMinTTL)
|
||||||
|
@ -291,9 +291,9 @@ func (pluginsState *PluginsState) ApplyResponsePlugins(pluginsGlobals *PluginsGl
|
||||||
pluginsGlobals.RLock()
|
pluginsGlobals.RLock()
|
||||||
defer pluginsGlobals.RUnlock()
|
defer pluginsGlobals.RUnlock()
|
||||||
for _, plugin := range *pluginsGlobals.responsePlugins {
|
for _, plugin := range *pluginsGlobals.responsePlugins {
|
||||||
if ret := plugin.Eval(pluginsState, &msg); ret != nil {
|
if err := plugin.Eval(pluginsState, &msg); err != nil {
|
||||||
pluginsState.action = PluginsActionDrop
|
pluginsState.action = PluginsActionDrop
|
||||||
return packet, ret
|
return packet, err
|
||||||
}
|
}
|
||||||
if pluginsState.action == PluginsActionReject {
|
if pluginsState.action == PluginsActionReject {
|
||||||
synth, err := RefusedResponseFromMessage(&msg, pluginsGlobals.refusedCodeInResponses, pluginsGlobals.respondWithIPv4, pluginsGlobals.respondWithIPv6, pluginsState.cacheMinTTL)
|
synth, err := RefusedResponseFromMessage(&msg, pluginsGlobals.refusedCodeInResponses, pluginsGlobals.respondWithIPv4, pluginsGlobals.respondWithIPv6, pluginsState.cacheMinTTL)
|
||||||
|
@ -329,8 +329,8 @@ func (pluginsState *PluginsState) ApplyLoggingPlugins(pluginsGlobals *PluginsGlo
|
||||||
pluginsGlobals.RLock()
|
pluginsGlobals.RLock()
|
||||||
defer pluginsGlobals.RUnlock()
|
defer pluginsGlobals.RUnlock()
|
||||||
for _, plugin := range *pluginsGlobals.loggingPlugins {
|
for _, plugin := range *pluginsGlobals.loggingPlugins {
|
||||||
if ret := plugin.Eval(pluginsState, questionMsg); ret != nil {
|
if err := plugin.Eval(pluginsState, questionMsg); err != nil {
|
||||||
return ret
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue