summaryrefslogtreecommitdiffstats
path: root/tcpsrv.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-30 14:51:45 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-30 14:51:45 +0200
commitb0d63ea8f26f525bbfd177aaa6a1294b0d94f1f9 (patch)
tree8ff1fa91347b213919636eb458ec8c5989e7ac3e /tcpsrv.c
parent055d4ffc2afc77e03a3d31720d4a0998f8c3d92c (diff)
downloadrsyslog-b0d63ea8f26f525bbfd177aaa6a1294b0d94f1f9.tar.gz
rsyslog-b0d63ea8f26f525bbfd177aaa6a1294b0d94f1f9.tar.xz
rsyslog-b0d63ea8f26f525bbfd177aaa6a1294b0d94f1f9.zip
made plain tcp syslog via TLS work on the server
... but so far only in blocking mode
Diffstat (limited to 'tcpsrv.c')
-rw-r--r--tcpsrv.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/tcpsrv.c b/tcpsrv.c
index 621f9d54..56d7464b 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -181,12 +181,15 @@ TCPSessGetNxtSess(tcpsrv_t *pThis, int iCurr)
{
register int i;
+ BEGINfunc
ISOBJ_TYPE_assert(pThis, tcpsrv);
+ assert(pThis->pSessions != NULL);
for(i = iCurr + 1 ; i < pThis->iSessMax ; ++i) {
if(pThis->pSessions[i] != NULL)
break;
}
+ ENDfunc
return((i < pThis->iSessMax) ? i : -1);
}
@@ -202,20 +205,20 @@ static void deinit_tcp_listener(tcpsrv_t *pThis)
int i;
ISOBJ_TYPE_assert(pThis, tcpsrv);
- assert(pThis->pSessions != NULL);
- /* close all TCP connections! */
- i = TCPSessGetNxtSess(pThis, -1);
- while(i != -1) {
- tcps_sess.Destruct(&pThis->pSessions[i]);
- /* now get next... */
- i = TCPSessGetNxtSess(pThis, i);
+ if(pThis->pSessions != NULL) {
+ /* close all TCP connections! */
+ i = TCPSessGetNxtSess(pThis, -1);
+ while(i != -1) {
+ tcps_sess.Destruct(&pThis->pSessions[i]);
+ /* now get next... */
+ i = TCPSessGetNxtSess(pThis, i);
+ }
+
+ /* we are done with the session table - so get rid of it... */
+ free(pThis->pSessions);
+ pThis->pSessions = NULL; /* just to make sure... */
}
-
- /* we are done with the session table - so get rid of it...
- */
- free(pThis->pSessions);
- pThis->pSessions = NULL; /* just to make sure... */
if(pThis->TCPLstnPort != NULL)
free(pThis->TCPLstnPort);
@@ -413,7 +416,6 @@ Run(tcpsrv_t *pThis)
/* Add the TCP listen sockets to the list of read descriptors. */
for(i = 0 ; i < pThis->iLstnMax ; ++i) {
-RUNLOG_VAR("%d", i);
CHKiRet(nssel.Add(pSel, pThis->ppLstn[i], NSDSEL_RD));
}