diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-06-18 11:23:04 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-06-18 14:40:58 -0400 |
commit | c041c677dcc194ec0280365c9621c46f92e56f7a (patch) | |
tree | 1d645fdffc304c25991c6928f0c5b1af986b22a5 /src/responder | |
parent | ce1ce193f2d2e07cdb66d26c4912f54de4bb1d92 (diff) | |
download | sssd-c041c677dcc194ec0280365c9621c46f92e56f7a.tar.gz sssd-c041c677dcc194ec0280365c9621c46f92e56f7a.tar.xz sssd-c041c677dcc194ec0280365c9621c46f92e56f7a.zip |
Make the client idle timeout configurable
Diffstat (limited to 'src/responder')
-rw-r--r-- | src/responder/common/responder.h | 1 | ||||
-rw-r--r-- | src/responder/common/responder_common.c | 23 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h index 8beabb6d8..e10e66ad5 100644 --- a/src/responder/common/responder.h +++ b/src/responder/common/responder.h @@ -86,6 +86,7 @@ struct resp_ctx { struct be_conn *be_conns; struct sss_domain_info *domains; + int client_idle_timeout; struct sysdb_ctx_list *db_list; struct sss_cmd_table *sss_cmds; diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c index 9a46c8882..e19480037 100644 --- a/src/responder/common/responder_common.c +++ b/src/responder/common/responder_common.c @@ -352,10 +352,8 @@ static void accept_fd_handler(struct tevent_context *ev, static errno_t reset_idle_timer(struct cli_ctx *cctx) { - struct timeval tv; - - /* TODO: make this configurable */ - tv = tevent_timeval_current_ofs(60, 0); + struct timeval tv = + tevent_timeval_current_ofs(cctx->rctx->client_idle_timeout, 0); talloc_zfree(cctx->idle); @@ -619,6 +617,23 @@ int sss_process_init(TALLOC_CTX *mem_ctx, rctx->priv_sock_name = sss_priv_pipe_name; rctx->confdb_service_path = confdb_service_path; + ret = confdb_get_int(rctx->cdb, NULL, + rctx->confdb_service_path, + CONFDB_RESPONDER_CLI_IDLE_TIMEOUT, + CONFDB_RESPONDER_CLI_IDLE_DEFAULT_TIMEOUT, + &rctx->client_idle_timeout); + if (ret != EOK) { + DEBUG(SSSDBG_OP_FAILURE, + ("Cannot get the client idle timeout [%d]: %s\n", + ret, strerror(ret))); + return ret; + } + + /* Ensure that the client timeout is at least ten seconds */ + if (rctx->client_idle_timeout < 10) { + rctx->client_idle_timeout = 10; + } + ret = confdb_get_domains(rctx->cdb, &rctx->domains); if (ret != EOK) { DEBUG(0, ("fatal error setting up domain map\n")); |