From: Michael Chase-S. <mc...@us...> - 2011-09-09 15:43:10
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via 09035e501fb18f007e841e82017d30ce97408e96 (commit) via c90a6b5b1d4edac091c7e79e6af8b7d969546428 (commit) from 6d2b8dd1f7a0c4856feac9593cae24b491dd73da (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 09035e501fb18f007e841e82017d30ce97408e96 Author: Michael Chase-Salerno <br...@li...> Date: Fri Sep 9 11:42:14 2011 -0400 3406823 Make select timeout a config option. commit c90a6b5b1d4edac091c7e79e6af8b7d969546428 Author: Michael Chase-Salerno <br...@li...> Date: Fri Sep 9 11:40:23 2011 -0400 3406823 Make select timeout a config option. ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 033aff1..7a20d98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-09-06 Michael Chase-Salerno <br...@li...> + * httpAdapter.c, sfcb.cfg.pre.in, control.c: + [ 3406823 ] Make select timeout a config option. + +2011-09-06 Michael Chase-Salerno <br...@li...> + * httpAdapter.c: [ 3400114 ] sfcb fails to start with ipv6 disabled Patch from kkaempf diff --git a/README b/README index a98707b..92b5689 100644 --- a/README +++ b/README @@ -505,6 +505,7 @@ file /usr/local/etc/sfcb/sfcb.cfg. For example: doBasicAuth: false basicAuthLib: sfcBasicAuthentication useChunking: true + selectTimeout: 5 keepaliveTimeout: 0 keepaliveMaxRequest: 10 sslKeyFilePath: /usr/local/etc/sfcb/file.pem @@ -577,6 +578,10 @@ enableSlp slpRefreshInterval timeinterval in seconds in which the slp process refreshes information +selectTimeout + Specify the maximum time in seconds for the HTTP select to complete. + Default is 5 seconds. + keepaliveTimeout Specify the maximum time in seconds an sfcb HTTP process will wait between two requests on one connection before terminating. Setting diff --git a/control.c b/control.c index e31d3fb..225e015 100644 --- a/control.c +++ b/control.c @@ -84,6 +84,7 @@ Control init[] = { {"keepaliveTimeout", 1, "15"}, {"keepaliveMaxRequest", 1, "10"}, + {"selectTimeout", 1, "5"}, {"providerSampleInterval", 1, "30"}, {"providerTimeoutInterval", 1, "60"}, diff --git a/httpAdapter.c b/httpAdapter.c index b308c7f..d4767bc 100644 --- a/httpAdapter.c +++ b/httpAdapter.c @@ -93,8 +93,8 @@ static int running = 0; static long keepaliveTimeout = 15; static long keepaliveMaxRequest = 10; static long numRequest; -struct timeval httpSelectTimeout = { 5, 0 }; /* 5 sec. timeout for - * select() before read() */ +static long selectTimeout = 5; /* default 5 sec. timeout for select() before read() */ +struct timeval httpSelectTimeout = { 0, 0 }; #if defined USE_SSL static SSL_CTX *ctx; @@ -1750,6 +1750,11 @@ httpDaemon(int argc, char *argv[], int sslMode) doUdsAuth = 0; #endif + // Get selectTimeout from the config file, or use 5 if not set + if (getControlNum("selectTimeout", &selectTimeout)) + selectTimeout = 5; + httpSelectTimeout.tv_sec=selectTimeout; + if (getControlNum("keepaliveTimeout", &keepaliveTimeout)) keepaliveTimeout = 15; @@ -1817,6 +1822,9 @@ httpDaemon(int argc, char *argv[], int sslMode) "--- Using Unix Socket Peer Cred Authentication\n"); #endif + + mlogf(M_INFO, M_SHOW, "--- Select timeout: %ld seconds\n", + selectTimeout); if (keepaliveTimeout == 0) { mlogf(M_INFO, M_SHOW, "--- Keep-alive timeout disabled\n"); } else { diff --git a/sfcb.cfg.pre.in b/sfcb.cfg.pre.in index fe3c8e2..6cefc75 100644 --- a/sfcb.cfg.pre.in +++ b/sfcb.cfg.pre.in @@ -64,6 +64,10 @@ doBasicAuth: false ## Default is: sfcBasicAuthentication basicAuthLib: @SFCB_CONF_BASICAUTHLIB@ +## Maximum time in seconds an sfcb HTTP process will wait for select. +## Default is 5 +#selectTimeout: 5 + ## Maximum time in seconds an sfcb HTTP process will wait between two requests ## on one connection before terminating. 0 will disable HTTP keep-alive. ## Default is 15 hooks/post-receive -- SFCB - Small Footprint CIM Broker |