Add some logging of dns cache operations
Added info about what entries are getting flushed due to ttl or size limits.
Change-Id: I69fb70ce23b5b820f5f1a5738c0f1aa57b6a1127
diff --git a/libc/netbsd/resolv/res_cache.c b/libc/netbsd/resolv/res_cache.c
index e3ceb5a..e88c221 100644
--- a/libc/netbsd/resolv/res_cache.c
+++ b/libc/netbsd/resolv/res_cache.c
@@ -1405,6 +1405,10 @@
XLOG("%s: OLDEST NOT IN HTABLE ?", __FUNCTION__);
return;
}
+ if (DEBUG) {
+ XLOG("Cache full - removing oldest");
+ XLOG_QUERY(oldest->query, oldest->querylen);
+ }
_cache_remove_p(cache, lookup);
}
@@ -1453,6 +1457,7 @@
/* remove stale entries here */
if (now >= e->expires) {
XLOG( " NOT IN CACHE (STALE ENTRY %p DISCARDED)", *lookup );
+ XLOG_QUERY(e->query, e->querylen);
_cache_remove_p(cache, lookup);
goto Exit;
}