aboutsummaryrefslogtreecommitdiff
path: root/lib/dns/server.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-05-17 22:16:46 +0700
committerShulhan <ms@kilabit.info>2022-05-17 22:16:46 +0700
commit345ee16b214a7a8cd3ca5d396a7c55a3a85b1bc2 (patch)
treecb5a3c692ad9832e37958425b82981d40a7126c5 /lib/dns/server.go
parenta44f87fbd19b1f9e2d99fbf1aefb91f13ebff6e3 (diff)
downloadpakakeh.go-345ee16b214a7a8cd3ca5d396a7c55a3a85b1bc2.tar.xz
lib/dns: return the removed record on caches RemoveCachesByRR
If the record being removed found on caches, it will return it; otherwise it will return nil without error.
Diffstat (limited to 'lib/dns/server.go')
-rw-r--r--lib/dns/server.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/dns/server.go b/lib/dns/server.go
index 03a4156f..cdfb0900 100644
--- a/lib/dns/server.go
+++ b/lib/dns/server.go
@@ -274,8 +274,9 @@ func (srv *Server) RemoveCachesByNames(names []string) (listAnswer []*Answer) {
// RemoveCachesByRR remove the answer from caches by ResourceRecord name,
// type, class, and value.
-func (srv *Server) RemoveCachesByRR(rr *ResourceRecord) error {
- return srv.caches.removeLocalRR(rr)
+func (srv *Server) RemoveCachesByRR(rr *ResourceRecord) (rrOut *ResourceRecord, err error) {
+ rrOut, err = srv.caches.removeLocalRR(rr)
+ return rrOut, err
}
// RemoveLocalCachesByNames remove local caches by domain names.