From 83bc461f812b3c3df260b5f75d84b34bb1135062 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 26 Apr 2010 13:02:04 -0400 Subject: Add dns_resolver_timeout option We had a hard-coded timeout of five seconds for DNS lookups in the async resolver. This patch adds an option 'dns_resolver_timeout' to specify this value (Default: 5) --- src/resolv/async_resolv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/resolv') diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c index 70d60e373..363141b4a 100644 --- a/src/resolv/async_resolv.c +++ b/src/resolv/async_resolv.c @@ -325,7 +325,7 @@ recreate_ares_channel(struct resolv_ctx *ctx) DEBUG(4, ("Initializing new c-ares channel\n")); /* FIXME: the options would contain * the nameservers to contact, the domains - * to search, timeout... => get from confdb + * to search... => get from confdb */ options.sock_state_cb = fd_event; options.sock_state_cb_data = ctx; @@ -358,6 +358,10 @@ resolv_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx, int ret; struct resolv_ctx *ctx; + if (timeout < 1) { + return EINVAL; + } + ctx = talloc_zero(mem_ctx, struct resolv_ctx); if (ctx == NULL) return ENOMEM; -- cgit