diff --git a/src/dns.c b/src/dns.c index 385ecbb6d..9984e2c31 100644 --- a/src/dns.c +++ b/src/dns.c @@ -348,11 +348,9 @@ void dns_trigger_resolution(struct dns_requester *req) /* The resolution must not be triggered yet. Use the cached response, if * valid */ exp = tick_add(res->last_resolution, resolvers->hold.valid); - if (res->status == RSLV_STATUS_VALID && - tick_isset(res->last_resolution) && !tick_is_expired(exp, now_ms)) - req->requester_cb(req, NULL); - else - dns_run_resolution(res); + if (resolvers->t && (res->status != RSLV_STATUS_VALID || + !tick_isset(res->last_resolution) || tick_is_expired(exp, now_ms))) + task_wakeup(resolvers->t, TASK_WOKEN_OTHER); }