From: Dave H. <hel...@us...> - 2013-03-18 05:25:45
|
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 8d061e0c31d538e785379ea7332d943bcbd405ce (commit) from ccaea0a9c9b39f4aa712f335d19e82f511322af7 (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 8d061e0c31d538e785379ea7332d943bcbd405ce Author: Dave Heller <hel...@us...> Date: Mon Mar 18 01:23:50 2013 -0400 [sfcb-tix:#30] Make maxBindAttempts a configurable option ----------------------------------------------------------------------- Summary of changes: control.c | 1 + httpAdapter.c | 5 +++-- sfcb.cfg.pre.in | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/control.c b/control.c index caaf5d2..5f6e1c0 100644 --- a/control.c +++ b/control.c @@ -104,6 +104,7 @@ Control init[] = { {"keepaliveTimeout", CTL_LONG, NULL, {.slong=15}}, {"keepaliveMaxRequest", CTL_LONG, NULL, {.slong=10}}, {"selectTimeout", CTL_LONG, NULL, {.slong=5}}, + {"maxBindAttempts", CTL_LONG, NULL, {.slong=8}}, {"providerSampleInterval", CTL_LONG, NULL, {.slong=30}}, {"providerTimeoutInterval", CTL_LONG, NULL, {.slong=60}}, diff --git a/httpAdapter.c b/httpAdapter.c index f24d0ef..c54ddf5 100644 --- a/httpAdapter.c +++ b/httpAdapter.c @@ -1760,8 +1760,9 @@ bindToPort(int sock, int port, char *ip, void *ssin, socklen_t * sin_len) if (!(sin = prepSockAddr4(ip, port, ssin, sin_len))) return 1; - int maxtries = 5; - int i = maxtries; + long maxtries = 8; + getControlNum("maxBindAttempts", &maxtries); + int i = maxtries = maxtries <= 0 ? 1 : maxtries; // ensure > 0 while (1) { if (!bind(sock, sin, *sin_len)) { if (!listen(sock, 10)) { diff --git a/sfcb.cfg.pre.in b/sfcb.cfg.pre.in index 3da634b..5806b96 100644 --- a/sfcb.cfg.pre.in +++ b/sfcb.cfg.pre.in @@ -102,6 +102,10 @@ basicAuthEntry: _sfcBasicAuthenticate ## Default is 5 #selectTimeout: 5 +## Maximum number of tries to bind a TCP socket before giving up. +## Default is 8 +#maxBindAttempts: 8 + ## 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 |