mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-21 13:40:42 +01:00
improved input thread termination for imtcp and imuxsock
This commit is contained in:
parent
5c0920c159
commit
d9f1a16de4
@ -330,6 +330,8 @@ CODESTARTrunInput
|
||||
break; /* terminate input! */
|
||||
|
||||
for (i = 0; i < nfunix && nfds > 0; i++) {
|
||||
if(glbl.GetGlobalInputTermState() == 1)
|
||||
ABORT_FINALIZE(RS_RET_FORCE_TERM); /* terminate input! */
|
||||
if ((fd = funix[i]) != -1 && FD_ISSET(fd, &readfds)) {
|
||||
readSocket(fd, i);
|
||||
--nfds; /* indicate we have processed one */
|
||||
@ -337,6 +339,7 @@ CODESTARTrunInput
|
||||
}
|
||||
}
|
||||
|
||||
finalize_it:
|
||||
RETiRet;
|
||||
ENDrunInput
|
||||
|
||||
|
||||
4
tcpsrv.c
4
tcpsrv.c
@ -565,6 +565,8 @@ Run(tcpsrv_t *pThis)
|
||||
break; /* terminate input! */
|
||||
|
||||
for(i = 0 ; i < pThis->iLstnCurr ; ++i) {
|
||||
if(glbl.GetGlobalInputTermState() == 1)
|
||||
ABORT_FINALIZE(RS_RET_FORCE_TERM);
|
||||
CHKiRet(nssel.IsReady(pSel, pThis->ppLstn[i], NSDSEL_RD, &bIsReady, &nfds));
|
||||
if(bIsReady) {
|
||||
DBGPRINTF("New connect on NSD %p.\n", pThis->ppLstn[i]);
|
||||
@ -576,6 +578,8 @@ Run(tcpsrv_t *pThis)
|
||||
/* now check the sessions */
|
||||
iTCPSess = TCPSessGetNxtSess(pThis, -1);
|
||||
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) {
|
||||
doReceive(pThis, &pThis->pSessions[iTCPSess]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user