diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2010-04-26 13:02:04 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-04-30 07:50:58 -0400 |
commit | fc28a2fa97feab70492b36afcc058d6b3fb52d79 (patch) | |
tree | 7f4540c19ac25c3e38e1f22714b917598b8119c2 /src/resolv | |
parent | c989a15469e72a479c7c689bf830adf78ec76c99 (diff) | |
download | sssd-fc28a2fa97feab70492b36afcc058d6b3fb52d79.tar.gz sssd-fc28a2fa97feab70492b36afcc058d6b3fb52d79.tar.xz sssd-fc28a2fa97feab70492b36afcc058d6b3fb52d79.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.c | 6 |
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; |