From c2edc94a3a25e835e18e094aab6c080a489986e6 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 6 Apr 2017 15:18:12 +0200 Subject: [PATCH] Clear timeout event when getting dnssec chain With full recursion --- src/general.c | 16 +++++++--------- .../225-stub-only-valgrind-checks.dsc | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/general.c b/src/general.c index b981470b..280df08d 100644 --- a/src/general.c +++ b/src/general.c @@ -219,16 +219,14 @@ _getdns_check_dns_req_complete(getdns_dns_req *dns_req) )) { /* Reschedule timeout for this DNS request */ - dns_req->timeout.userarg = dns_req; - dns_req->timeout.read_cb = NULL; - dns_req->timeout.write_cb = NULL; - dns_req->timeout.timeout_cb = - (getdns_eventloop_callback) - _getdns_validation_chain_timeout; - dns_req->timeout.ev = NULL; - (void) dns_req->loop->vmt->schedule(dns_req->loop, -1, + if (dns_req->timeout.timeout_cb && dns_req->timeout.ev) + GETDNS_CLEAR_EVENT(dns_req->loop, &dns_req->timeout); + + GETDNS_SCHEDULE_EVENT(dns_req->loop, -1, _getdns_ms_until_expiry2(dns_req->expires, &now_ms), - &dns_req->timeout); + getdns_eventloop_event_init(&dns_req->timeout, dns_req, + NULL, NULL, (getdns_eventloop_callback) + _getdns_validation_chain_timeout)); _getdns_get_validation_chain(dns_req); } else diff --git a/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.dsc b/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.dsc index d845ad44..7167a541 100644 --- a/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.dsc +++ b/src/test/tpkg/225-stub-only-valgrind-checks.tpkg/225-stub-only-valgrind-checks.dsc @@ -6,7 +6,7 @@ Maintainer: Willem Toorop Category: Component: CmdDepends: valgrind -Depends: 110-link.tpkg +Depends: 210-stub-only-link.tpkg Help: Pre: Post: