]> git.ipfire.org Git - thirdparty/bind9.git/commit
Rewrite dns_resolver and dns_request to use netmgr timeouts
authorEvan Hunt <each@isc.org>
Fri, 23 Apr 2021 01:58:01 +0000 (18:58 -0700)
committerEvan Hunt <each@isc.org>
Sat, 2 Oct 2021 18:39:56 +0000 (11:39 -0700)
commit08ce69a0ea1c33cbf62b6b5896affb047a71be42
treec7bf5dc42a25b439de6212617cc00f70ab9cee8b
parent308bc46a59302c88ecff11d4831475ecfa8b8fb0
Rewrite dns_resolver and dns_request to use netmgr timeouts

- The `timeout_action` parameter to dns_dispatch_addresponse() been
  replaced with a netmgr callback that is called when a dispatch read
  times out.  this callback may optionally reset the read timer and
  resume reading.

- Added a function to convert isc_interval to milliseconds; this is used
  to translate fctx->interval into a value that can be passed to
  dns_dispatch_addresponse() as the timeout.

- Note that netmgr timeouts are accurate to the millisecond, so code to
  check whether a timeout has been reached cannot rely on microsecond
  accuracy.

- If serve-stale is configured, then a timeout received by the resolver
  may trigger it to return stale data, and then resume waiting for the
  read timeout. this is no longer based on a separate stale timer.

- The code for canceling requests in request.c has been altered so that
  it can run asynchronously.

- TCP timeout events apply to the dispatch, which may be shared by
  multiple queries.  since in the event of a timeout we have no query ID
  to use to identify the resp we wanted, we now just send the timeout to
  the oldest query that was pending.

- There was some additional refactoring in the resolver: combining
  fctx_join() and fctx_try_events() into one function to reduce code
  duplication, and using fixednames in fetchctx and fetchevent.

- Incidental fix: new_adbaddrinfo() can't return NULL anymore, so the
  code can be simplified.
14 files changed:
lib/dns/adb.c
lib/dns/client.c
lib/dns/dispatch.c
lib/dns/include/dns/dispatch.h
lib/dns/include/dns/resolver.h
lib/dns/lookup.c
lib/dns/request.c
lib/dns/resolver.c
lib/dns/validator.c
lib/isc/include/isc/netmgr.h
lib/isc/include/isc/time.h
lib/isc/netmgr/netmgr.c
lib/isc/time.c
lib/ns/query.c