diff options
| author | Shulhan <ms@kilabit.info> | 2019-01-16 15:44:49 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2019-01-16 15:44:49 +0700 |
| commit | 03ef212ef68f36569501db146a55d7febb2f46ce (patch) | |
| tree | 69a8a2e94c6018d4043724e6203a0f571b4d7c11 /cacheworker.go | |
| parent | 0e6b601963cde59e24656597ac7e8549a861d2d5 (diff) | |
| download | rescached-03ef212ef68f36569501db146a55d7febb2f46ce.tar.xz | |
cacheworker.go: do not cache DNS message with non OK status code
In case parent server return "Server failure", we should not cache the
message, in case the next request may return OK status code.
Diffstat (limited to 'cacheworker.go')
| -rw-r--r-- | cacheworker.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cacheworker.go b/cacheworker.go index d6c5376..b1f0e49 100644 --- a/cacheworker.go +++ b/cacheworker.go @@ -80,6 +80,7 @@ func (cw *cacheWorker) add(msg *dns.Message, isLocal bool) bool { if msg.Header.RCode != dns.RCodeOK { log.Printf("! Response error: %d %s\n", msg.Header.RCode, msg.Question) + return false } libbytes.ToLower(&msg.Question.Name) |
