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/providers/data_provider_fo.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/providers/data_provider_fo.c') diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c index 482f7444..cbdb7862 100644 --- a/src/providers/data_provider_fo.c +++ b/src/providers/data_provider_fo.c @@ -93,6 +93,7 @@ static int be_fo_get_options(TALLOC_CTX *mem_ctx, struct be_ctx *ctx, int be_init_failover(struct be_ctx *ctx) { int ret; + int fo_timeout; struct fo_options fopts; if (ctx->be_fo != NULL) { @@ -104,7 +105,14 @@ int be_init_failover(struct be_ctx *ctx) return ENOMEM; } - ret = resolv_init(ctx, ctx->ev, 5, &ctx->be_fo->resolv); + ret = confdb_get_int(ctx->cdb, ctx, ctx->conf_path, + CONFDB_DOMAIN_RESOLV_TIMEOUT, + 5, &fo_timeout); + if (ret != EOK) { + return ret; + } + + ret = resolv_init(ctx, ctx->ev, fo_timeout, &ctx->be_fo->resolv); if (ret != EOK) { talloc_zfree(ctx->be_fo); return ret; -- cgit