From 81c012787fabf734d9c952c6f18ecac21929d4d8 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 20 Dec 2016 09:53:58 +0100 Subject: dirmngr: New option --resolver-timeout. * dirmngr/dns-stuff.c (DEFAULT_TIMEOUT): New. (opt_timeout): New var. (set_dns_timeout): New. (libdns_res_open): Set the default timeout. (libdns_res_wait): Use configurable timeout. (resolve_name_libdns): Ditto. * dirmngr/dirmngr.c (oResolverTimeout): New const. (opts): New option --resolver-timeout. (parse_rereadable_options): Set that option. (main) : Add --nameserver and --resolver-timeout. * tools/gpgconf-comp.c (gc_options_dirmngr): Add --resolver-timeout and --nameserver. * dirmngr/http.c (connect_server): Fix yesterday introduced bug in error diagnostic. -- This timeout is a pretty crude thing because libdns has a few other internal timeouts as well. Signed-off-by: Werner Koch --- dirmngr/dns-stuff.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'dirmngr/dns-stuff.h') diff --git a/dirmngr/dns-stuff.h b/dirmngr/dns-stuff.h index 075aeafab..0a4a4de2f 100644 --- a/dirmngr/dns-stuff.h +++ b/dirmngr/dns-stuff.h @@ -95,6 +95,9 @@ struct srventry /* Set verbosity and debug mode for this module. */ void set_dns_verbose (int verbose, int debug); +/* Set the timeout for libdns requests to SECONDS. */ +void set_dns_timeout (int seconds); + /* Calling this function with YES set to True forces the use of the * standard resolver even if dirmngr has been built with support for * an alternative resolver. */ -- cgit v1.2.3