summaryrefslogtreecommitdiffstats
path: root/src/resolv
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-04-26 13:02:04 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-04-30 07:51:19 -0400
commit83bc461f812b3c3df260b5f75d84b34bb1135062 (patch)
tree7a0a98cedea387a575e1c7410a308bb28c098b28 /src/resolv
parent01c94127cf0fd72b6db828f1830fff1e5ed55bd1 (diff)
downloadsssd-83bc461f812b3c3df260b5f75d84b34bb1135062.tar.gz
sssd-83bc461f812b3c3df260b5f75d84b34bb1135062.tar.xz
sssd-83bc461f812b3c3df260b5f75d84b34bb1135062.zip
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)
Diffstat (limited to 'src/resolv')
-rw-r--r--src/resolv/async_resolv.c6
1 files changed, 5 insertions, 1 deletions
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;