summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-04-09 13:36:44 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-04-09 13:36:44 +0200
commitbc471f1d9046bf75a2e27d593ce9b13e4094ffdc (patch)
tree7ac9b6f0f3e21bba00f86ccf354014c5babc5c15
parent5e4fc93dd523f209f78cef8a231e24975910e5ca (diff)
downloadrsyslog-bc471f1d9046bf75a2e27d593ce9b13e4094ffdc.tar.gz
rsyslog-bc471f1d9046bf75a2e27d593ce9b13e4094ffdc.tar.xz
rsyslog-bc471f1d9046bf75a2e27d593ce9b13e4094ffdc.zip
bugfix: $InputTCPMaxSessions config directive was accepted, but not honored
This resulted in a fixed upper limit of 200 connections.
-rw-r--r--ChangeLog4
-rw-r--r--plugins/imtcp/imtcp.c1
-rw-r--r--tcpsrv.c15
-rw-r--r--tcpsrv.h4
4 files changed, 23 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8726be28..854195c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
---------------------------------------------------------------------------
+Version 3.20.6 [v3-stable] (rgerhards), 2009-04-??
+- bugfix: $InputTCPMaxSessions config directive was accepted, but not
+ honored. This resulted in a fixed upper limit of 200 connections.
+---------------------------------------------------------------------------
Version 3.20.5 [v3-stable] (rgerhards), 2009-04-02
- bugfix: potential abort with DA queue after high watermark is reached
There exists a race condition that can lead to a segfault. Thanks
diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c
index 89f1dbcf..7b3eeda5 100644
--- a/plugins/imtcp/imtcp.c
+++ b/plugins/imtcp/imtcp.c
@@ -160,6 +160,7 @@ static rsRetVal addTCPListener(void __attribute__((unused)) *pVal, uchar *pNewVa
if(pOurTcpsrv == NULL) {
CHKiRet(tcpsrv.Construct(&pOurTcpsrv));
+ CHKiRet(tcpsrv.SetSessMax(pOurTcpsrv, iTCPSessMax));
CHKiRet(tcpsrv.SetCBIsPermittedHost(pOurTcpsrv, isPermittedHost));
CHKiRet(tcpsrv.SetCBRcvData(pOurTcpsrv, doRcvData));
CHKiRet(tcpsrv.SetCBOpenLstnSocks(pOurTcpsrv, doOpenLstnSocks));
diff --git a/tcpsrv.c b/tcpsrv.c
index 85b34947..7f72cf1e 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -703,6 +703,20 @@ SetDrvrPermPeers(tcpsrv_t *pThis, permittedPeers_t *pPermPeers)
* -------------------------------------------------------------------------- */
+/* set max number of sessions
+ * this must be called before ConstructFinalize, or it will have no effect!
+ * rgerhards, 2009-04-09
+ */
+static rsRetVal
+SetSessMax(tcpsrv_t *pThis, int iMax)
+{
+ DEFiRet;
+ ISOBJ_TYPE_assert(pThis, tcpsrv);
+ pThis->iSessMax = iMax;
+ RETiRet;
+}
+
+
/* queryInterface function
* rgerhards, 2008-02-29
*/
@@ -728,6 +742,7 @@ CODESTARTobjQueryInterface(tcpsrv)
pIf->Run = Run;
pIf->SetUsrP = SetUsrP;
+ pIf->SetSessMax = SetSessMax;
pIf->SetDrvrMode = SetDrvrMode;
pIf->SetDrvrAuthMode = SetDrvrAuthMode;
pIf->SetDrvrPermPeers = SetDrvrPermPeers;
diff --git a/tcpsrv.h b/tcpsrv.h
index 01110866..280f5083 100644
--- a/tcpsrv.h
+++ b/tcpsrv.h
@@ -79,8 +79,10 @@ BEGINinterface(tcpsrv) /* name must also be changed in ENDinterface macro! */
rsRetVal (*SetCBOnSessAccept)(tcpsrv_t*, rsRetVal (*) (tcpsrv_t*, tcps_sess_t*));
rsRetVal (*SetCBOnSessDestruct)(tcpsrv_t*, rsRetVal (*) (void*));
rsRetVal (*SetCBOnSessConstructFinalize)(tcpsrv_t*, rsRetVal (*) (void*));
+ /* added v4 */
+ rsRetVal (*SetSessMax)(tcpsrv_t *pThis, int iMaxSess); /* 2009-04-09 */
ENDinterface(tcpsrv)
-#define tcpsrvCURR_IF_VERSION 3 /* increment whenever you change the interface structure! */
+#define tcpsrvCURR_IF_VERSION 4 /* increment whenever you change the interface structure! */
/* prototypes */