Skip to content

Commit 79cf9b4

Browse files
committed
dnscache: use timeutils/cache.c instead of iv_now
Otherwise we had a lot of clock_gettime() calls. Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
1 parent 1a2b4f9 commit 79cf9b4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/dnscache.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ dns_cache_store(DNSCache *self, gboolean persistent, gint family, void *addr, co
161161
INIT_IV_LIST_HEAD(&entry->list);
162162
if (!persistent)
163163
{
164-
entry->resolved = iv_now.tv_sec;
164+
entry->resolved = get_cached_realtime_sec();
165165
iv_list_add(&entry->list, &self->cache_list);
166166
}
167167
else
@@ -304,8 +304,7 @@ dns_cache_lookup(DNSCache *self, gint family, void *addr, const gchar **hostname
304304
DNSCacheEntry *entry;
305305
time_t now;
306306

307-
iv_validate_now();
308-
now = iv_now.tv_sec;
307+
now = get_cached_realtime_sec();
309308
dns_cache_check_hosts(self, now);
310309

311310
dns_cache_fill_key(&key, family, addr);

0 commit comments

Comments
 (0)