From 79cf9b4bb2240fd3052ccdb186313806b604c585 Mon Sep 17 00:00:00 2001 From: Balazs Scheidler Date: Sat, 30 Nov 2024 23:22:00 +0100 Subject: [PATCH] dnscache: use timeutils/cache.c instead of iv_now Otherwise we had a lot of clock_gettime() calls. Signed-off-by: Balazs Scheidler --- lib/dnscache.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/dnscache.c b/lib/dnscache.c index a640e6eee5..5960dc2919 100644 --- a/lib/dnscache.c +++ b/lib/dnscache.c @@ -161,7 +161,7 @@ dns_cache_store(DNSCache *self, gboolean persistent, gint family, void *addr, co INIT_IV_LIST_HEAD(&entry->list); if (!persistent) { - entry->resolved = iv_now.tv_sec; + entry->resolved = get_cached_realtime_sec(); iv_list_add(&entry->list, &self->cache_list); } else @@ -304,8 +304,7 @@ dns_cache_lookup(DNSCache *self, gint family, void *addr, const gchar **hostname DNSCacheEntry *entry; time_t now; - iv_validate_now(); - now = iv_now.tv_sec; + now = get_cached_realtime_sec(); dns_cache_check_hosts(self, now); dns_cache_fill_key(&key, family, addr);