summaryrefslogtreecommitdiffstats
path: root/tcpsrv.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-06-14 15:09:41 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-06-14 15:09:41 +0200
commitfee33477845949c2f03000044b2dbc31382b48f1 (patch)
treed8ed2472205504b72273b088486f01d42d4c98de /tcpsrv.c
parent7f0c927623b6425fee2c39b2d5207d7c36e32acd (diff)
parent28af40670e9dc1a85a24dfcbb093ddc1171e151f (diff)
downloadrsyslog-fee33477845949c2f03000044b2dbc31382b48f1.tar.gz
rsyslog-fee33477845949c2f03000044b2dbc31382b48f1.tar.xz
rsyslog-fee33477845949c2f03000044b2dbc31382b48f1.zip
Merge branch 'v5-stable' into beta
Conflicts: ChangeLog runtime/nsd_gtls.c tcpsrv.c tests/Makefile.am
Diffstat (limited to 'tcpsrv.c')
-rw-r--r--tcpsrv.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tcpsrv.c b/tcpsrv.c
index 2c97d522..c091df0b 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -704,6 +704,7 @@ RunSelect(tcpsrv_t *pThis, nsd_epworkset_t workset[], size_t sizeWorkset)
int iTCPSess;
int bIsReady;
nssel_t *pSel = NULL;
+ rsRetVal localRet;
ISOBJ_TYPE_assert(pThis, tcpsrv);
@@ -760,8 +761,8 @@ RunSelect(tcpsrv_t *pThis, nsd_epworkset_t workset[], size_t sizeWorkset)
while(nfds && iTCPSess != -1) {
if(glbl.GetGlobalInputTermState() == 1)
ABORT_FINALIZE(RS_RET_FORCE_TERM);
- CHKiRet(nssel.IsReady(pSel, pThis->pSessions[iTCPSess]->pStrm, NSDSEL_RD, &bIsReady, &nfds));
- if(bIsReady) {
+ localRet = nssel.IsReady(pSel, pThis->pSessions[iTCPSess]->pStrm, NSDSEL_RD, &bIsReady, &nfds);
+ if(bIsReady || localRet != RS_RET_OK) {
workset[iWorkset].id = iTCPSess;
workset[iWorkset].pUsr = (void*) pThis->pSessions[iTCPSess];
++iWorkset;
@@ -785,7 +786,9 @@ finalize_it: /* this is a very special case - this time only we do not exit the
* crashed, which made sense (the rest of the engine was not prepared for
* that) -- rgerhards, 2008-05-19
*/
- /*EMPTY*/;
+ if(pSel != NULL) { /* cleanup missing? happens during err exit! */
+ nssel.Destruct(&pSel);
+ }
}
/* note that this point is usually not reached */