|
From: Dave H. <hel...@us...> - 2013-03-18 05:44:32
|
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_1.3 has been updated
via b25098dc9bbb52d44887aaa9a82d991ee4114c01 (commit)
from 957d0c9923d51758b72e5e6493dc5f10e7310626 (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 b25098dc9bbb52d44887aaa9a82d991ee4114c01
Author: Dave Heller <hel...@us...>
Date: Mon Mar 18 01:43:10 2013 -0400
[sfcb-tix:#30] Make maxBindAttempts a configurable option
-----------------------------------------------------------------------
Summary of changes:
control.c | 1 +
httpAdapter.c | 6 +++---
sfcb.cfg.pre.in | 4 ++++
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/control.c b/control.c
index 711211a..1faa547 100644
--- a/control.c
+++ b/control.c
@@ -98,6 +98,7 @@ Control init[] = {
{"keepaliveTimeout", 1, "15"},
{"keepaliveMaxRequest", 1, "10"},
{"selectTimeout", 1, "5"},
+ {"maxBindAttempts", 1, "8"},
{"providerSampleInterval", 1, "30"},
{"providerTimeoutInterval", 1, "60"},
diff --git a/httpAdapter.c b/httpAdapter.c
index 7b28435..6f8e22d 100644
--- a/httpAdapter.c
+++ b/httpAdapter.c
@@ -1562,8 +1562,9 @@ bindToPort(int sock, int port, void *ssin, socklen_t * sin_len)
if (!(sin = prepSockAddr4(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)) {
@@ -1732,7 +1733,6 @@ initSSL()
}
#endif // USE_SSL
-
int httpDaemon(int argc, char *argv[], int sslMode, int sfcbPid)
{
diff --git a/sfcb.cfg.pre.in b/sfcb.cfg.pre.in
index 34f2145..55057ef 100644
--- a/sfcb.cfg.pre.in
+++ b/sfcb.cfg.pre.in
@@ -68,6 +68,10 @@ basicAuthLib: @SFCB_CONF_BASICAUTHLIB@
## Default is 5
#selectTimeout: 5
+## Maximum number of tries to bind a TCP socket before giving up.
+## Default is 8
+#maxBindAttempts: 8
+
## Name of the entry point into the authentication library
## The return code of this function will determine if auth passes or fails
## Default is: _sfcBasicAuthenticate
hooks/post-receive
--
sfcb - Small Footprint CIM Broker
|