Fix delv default timeout value

The isc_nm_getinitialtimeout() function (and also the previously used
isc_nm_gettimeouts() function) returns timeout value(s) in milliseconds,
while the dns_request_create() function expects timeout values in
seconds. Fix the bug by dividing the timeout value by MS_PER_SEC.

There is no added test, because it turns out delv doesn't support
setting custom timeout values (as opposed to what is suggested in
its man page). Tests should be added later when the '+timeout=T'
option is implemented.
This commit is contained in:
Aram Sargsyan 2025-03-11 12:24:43 +00:00 committed by Arаm Sаrgsyаn
parent 74a8acdc8d
commit e3417d55fd

View file

@ -2096,7 +2096,8 @@ sendquery(void *arg) {
dns_view_attach(view, &(dns_view_t *){ NULL });
const unsigned int timeout = isc_nm_getinitialtimeout(netmgr);
const unsigned int timeout = isc_nm_getinitialtimeout(netmgr) /
MS_PER_SEC;
CHECK(dns_request_create(requestmgr, message, NULL, &peer, NULL, NULL,
DNS_REQUESTOPT_TCP, NULL, timeout, timeout, 0,
0, isc_loop(), recvresponse, message,