static struct uloop_timeout cache_gc;
struct avl_tree services;
-static AVL_TREE(records, avl_strcmp, true, NULL);
+AVL_TREE(records, avl_strcmp, true, NULL);
static void
cache_record_free(struct cache_record *r)
continue;
}
s->refresh += 50;
- dns_send_question(s->iface, s->entry, TYPE_PTR, 0);
+ if (cache_service_is_host(s)) {
+ dns_send_question(s->iface, s->entry, TYPE_A, 0);
+ dns_send_question(s->iface, s->entry, TYPE_AAAA, 0);
+ } else {
+ dns_send_question(s->iface, s->entry, TYPE_PTR, 0);
+ }
}
uloop_timeout_set(timeout, 10000);
}
void
-cache_scan(void)
+cache_update(void)
{
struct interface *iface;
struct cache_service *s;
if (!strcmp(s->entry, entry)) {
s->refresh = 50;
s->time = monotonic_time();
+ s->ttl = ttl;
return s;
}