summaryrefslogtreecommitdiff
path: root/src/responder
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-06-18 11:23:04 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-06-18 14:37:59 -0400
commitbb79e7559dae451a14150377099e32d6b5159a6c (patch)
tree0410bbb6f6c50e1388c8a6e18e3812b36086d4e2 /src/responder
parentdd94e9c9c586fb2c2a0e7175251c08c2762598b0 (diff)
downloadsssd-bb79e7559dae451a14150377099e32d6b5159a6c.tar.gz
sssd-bb79e7559dae451a14150377099e32d6b5159a6c.tar.bz2
sssd-bb79e7559dae451a14150377099e32d6b5159a6c.zip
Make the client idle timeout configurable
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/common/responder.h1
-rw-r--r--src/responder/common/responder_common.c22
2 files changed, 19 insertions, 4 deletions
diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h
index 67884ed7..43a4fa02 100644
--- a/src/responder/common/responder.h
+++ b/src/responder/common/responder.h
@@ -87,6 +87,7 @@ struct resp_ctx {
struct sss_domain_info *domains;
int domains_timeout;
+ 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 3c269725..242fae99 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);
@@ -620,6 +618,22 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
rctx->confdb_service_path = confdb_service_path;
ret = confdb_get_int(rctx->cdb, 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_int(rctx->cdb, rctx->confdb_service_path,
CONFDB_RESPONDER_GET_DOMAINS_TIMEOUT,
GET_DOMAINS_DEFAULT_TIMEOUT, &rctx->domains_timeout);
if (ret != EOK) {