summaryrefslogtreecommitdiffstats
path: root/tcpsrv.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-02-01 22:58:30 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-02-01 22:58:30 +0100
commitbea499dcb2747d1f5b42eae4978cfe86a37dc957 (patch)
treef10f76b45621bf081572aa76641b308c564aebce /tcpsrv.c
parentfd256a09ffa109120304d293cf6faf808c5a1a21 (diff)
downloadrsyslog-bea499dcb2747d1f5b42eae4978cfe86a37dc957.tar.gz
rsyslog-bea499dcb2747d1f5b42eae4978cfe86a37dc957.tar.xz
rsyslog-bea499dcb2747d1f5b42eae4978cfe86a37dc957.zip
(somewhat) improved TLS subsystem
- improved TLS error reporting - improved TLS startup (Diffie-Hellman bits do not need to be generated, as we do not support full anon key exchange -- we always need certs)
Diffstat (limited to 'tcpsrv.c')
-rw-r--r--tcpsrv.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tcpsrv.c b/tcpsrv.c
index d86bff6b..c031a591 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -577,10 +577,14 @@ processWorksetItem(tcpsrv_t *pThis, nspoll_t *pPoll, int idx, void *pUsr)
if(pUsr == pThis->ppLstn) {
//printf("work item %p: connect\n", pUsr);
DBGPRINTF("New connect on NSD %p.\n", pThis->ppLstn[idx]);
- SessAccept(pThis, pThis->ppLstnPort[idx], &pNewSess, pThis->ppLstn[idx]);
- if(pPoll != NULL)
- CHKiRet(nspoll.Ctl(pPoll, pNewSess->pStrm, 0, pNewSess, NSDPOLL_IN, NSDPOLL_ADD));
- DBGPRINTF("New session created with NSD %p.\n", pNewSess);
+ iRet = SessAccept(pThis, pThis->ppLstnPort[idx], &pNewSess, pThis->ppLstn[idx]);
+ if(iRet == RS_RET_OK) {
+ if(pPoll != NULL)
+ CHKiRet(nspoll.Ctl(pPoll, pNewSess->pStrm, 0, pNewSess, NSDPOLL_IN, NSDPOLL_ADD));
+ DBGPRINTF("New session created with NSD %p.\n", pNewSess);
+ } else {
+ DBGPRINTF("tcpsrv: error %d during accept\n", iRet);
+ }
} else {
//printf("work item %p: receive\n", pUsr);
pNewSess = (tcps_sess_t*) pUsr;