summaryrefslogtreecommitdiffstats
path: root/src/providers/data_provider_fo.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-12-20 16:30:02 +0100
committerStephen Gallagher <sgallagh@redhat.com>2011-12-20 13:37:28 -0500
commitb8ecc581cdd8c7d097bf9db67a4cb220fbbcff6d (patch)
tree113391828a6066980c3156ec936958efd272f3bd /src/providers/data_provider_fo.c
parentf76cb01f05f7c1764028084b166f65c3ff4e670f (diff)
downloadsssd-b8ecc581cdd8c7d097bf9db67a4cb220fbbcff6d.tar.gz
sssd-b8ecc581cdd8c7d097bf9db67a4cb220fbbcff6d.tar.xz
sssd-b8ecc581cdd8c7d097bf9db67a4cb220fbbcff6d.zip
Failover: Introduce a per-service timeout
https://fedorahosted.org/sssd/ticket/976
Diffstat (limited to 'src/providers/data_provider_fo.c')
-rw-r--r--src/providers/data_provider_fo.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c
index 7a5c82c3e..dd73e9d97 100644
--- a/src/providers/data_provider_fo.c
+++ b/src/providers/data_provider_fo.c
@@ -67,7 +67,14 @@ static int be_fo_get_options(struct be_ctx *ctx,
{
errno_t ret;
- /* todo get timeout from configuration */
+ ret = confdb_get_int(ctx->cdb, ctx, ctx->conf_path,
+ CONFDB_DOMAIN_RESOLV_TIMEOUT,
+ FO_DEFAULT_SVC_TIMEOUT,
+ &opts->service_resolv_timeout);
+ if (ret != EOK) {
+ return ret;
+ }
+
opts->retry_timeout = 30;
opts->srv_retry_timeout = 14400;
@@ -83,7 +90,7 @@ static int be_fo_get_options(struct be_ctx *ctx,
int be_init_failover(struct be_ctx *ctx)
{
int ret;
- int fo_timeout;
+ int resolv_timeout;
struct fo_options fopts;
if (ctx->be_fo != NULL) {
@@ -96,13 +103,14 @@ int be_init_failover(struct be_ctx *ctx)
}
ret = confdb_get_int(ctx->cdb, ctx, ctx->conf_path,
- CONFDB_DOMAIN_RESOLV_TIMEOUT,
- RESOLV_DEFAULT_TIMEOUT, &fo_timeout);
+ CONFDB_DOMAIN_RESOLV_OP_TIMEOUT,
+ RESOLV_DEFAULT_TIMEOUT,
+ &resolv_timeout);
if (ret != EOK) {
return ret;
}
- ret = resolv_init(ctx, ctx->ev, fo_timeout, &ctx->be_fo->resolv);
+ ret = resolv_init(ctx, ctx->ev, resolv_timeout, &ctx->be_fo->resolv);
if (ret != EOK) {
talloc_zfree(ctx->be_fo);
return ret;