diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-23 16:31:35 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-23 16:31:35 +0200 |
commit | 50fe2ec2ea275b7ed38c7942736fbb2aae727056 (patch) | |
tree | 85a43771dbe9dca798a69c941fb83c8396f4fc1f /tcpsrv.c | |
parent | 1892fc75f9fad0b0741b4a3eb1fc382f900b2301 (diff) | |
download | rsyslog-50fe2ec2ea275b7ed38c7942736fbb2aae727056.tar.gz rsyslog-50fe2ec2ea275b7ed38c7942736fbb2aae727056.tar.bz2 rsyslog-50fe2ec2ea275b7ed38c7942736fbb2aae727056.zip |
removed listener array from inidividual netstrm (mostly finished)
Diffstat (limited to 'tcpsrv.c')
-rw-r--r-- | tcpsrv.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -236,7 +236,15 @@ addTcpLstn(void *pUsr, netstrm_t *pLstn) DEFiRet; ISOBJ_TYPE_assert(pThis, tcpsrv); + ISOBJ_TYPE_assert(pLstn, netstrm); + if(pThis->iLstnMax >= TCPLSTN_MAX_DEFAULT) + ABORT_FINALIZE(RS_RET_MAX_LSTN_REACHED); + + pThis->ppLstn[pThis->iLstnMax] = pLstn; + ++pThis->iLstnMax; + +finalize_it: RETiRet; } @@ -264,7 +272,20 @@ create_tcp_socket(tcpsrv_t *pThis) TCPLstnPort = (uchar*)pThis->TCPLstnPort; /* TODO: add capability to specify local listen address! */ - CHKiRet(netstrm.LstnInit((void*)pThis, addTcpLstn, TCPLstnPort, NULL, pThis->iSessMax)); + CHKiRet(netstrm.LstnInit(pThis->pNS, (void*)pThis, addTcpLstn, TCPLstnPort, NULL, pThis->iSessMax)); + + + /* OK, we had success. Now it is also time to + * initialize our connections + */ + if(TCPSessTblInit(pThis) != 0) { + /* OK, we are in some trouble - we could not initialize the + * session table, so we can not continue. We need to free all + * we have assigned so far, because we can not really use it... + */ + errmsg.LogError(NO_ERRCODE, "Could not initialize TCP session table, suspending TCP message reception."); + ABORT_FINALIZE(RS_RET_ERR); + } finalize_it: RETiRet; |