Add a NOT_READY return code
This commit is contained in:
parent
f9ec0a9c09
commit
daa1f3d3b1
|
@ -46,6 +46,7 @@ const (
|
|||
PluginsReturnCodeNetworkError
|
||||
PluginsReturnCodeCloak
|
||||
PluginsReturnCodeServerTimeout
|
||||
PluginsReturnCodeNotReady
|
||||
)
|
||||
|
||||
var PluginsReturnCodeToString = map[PluginsReturnCode]string{
|
||||
|
@ -61,6 +62,7 @@ var PluginsReturnCodeToString = map[PluginsReturnCode]string{
|
|||
PluginsReturnCodeNetworkError: "NETWORK_ERROR",
|
||||
PluginsReturnCodeCloak: "CLOAK",
|
||||
PluginsReturnCodeServerTimeout: "SERVER_TIMEOUT",
|
||||
PluginsReturnCodeNotReady: "NOT_READY",
|
||||
}
|
||||
|
||||
type PluginsState struct {
|
||||
|
|
|
@ -716,7 +716,11 @@ func (proxy *Proxy) processIncomingQuery(clientProto string, serverProto string,
|
|||
}
|
||||
}
|
||||
if len(response) < MinDNSPacketSize || len(response) > MaxDNSPacketSize {
|
||||
pluginsState.returnCode = PluginsReturnCodeParseError
|
||||
if len(response) == 0 {
|
||||
pluginsState.returnCode = PluginsReturnCodeNotReady
|
||||
} else {
|
||||
pluginsState.returnCode = PluginsReturnCodeParseError
|
||||
}
|
||||
pluginsState.ApplyLoggingPlugins(&proxy.pluginsGlobals)
|
||||
if serverInfo != nil {
|
||||
serverInfo.noticeFailure(proxy)
|
||||
|
|
Loading…
Reference in New Issue