mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-20 07:20:41 +01:00
shuffle code to be in closer proximity of related functions
This commit is contained in:
parent
c4af90f626
commit
43d922f1b1
70
action.c
70
action.c
@ -1279,6 +1279,41 @@ finalize_it:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Call configured action, most complex case with all features supported (and thus slow).
|
||||||
|
* rgerhards, 2010-06-08
|
||||||
|
*/
|
||||||
|
#pragma GCC diagnostic ignored "-Wempty-body"
|
||||||
|
static rsRetVal
|
||||||
|
doSubmitToActionQComplex(action_t *pAction, wti_t *pWti, msg_t *pMsg)
|
||||||
|
{
|
||||||
|
DEFiRet;
|
||||||
|
|
||||||
|
d_pthread_mutex_lock(&pAction->mutAction);
|
||||||
|
pthread_cleanup_push(mutexCancelCleanup, &pAction->mutAction);
|
||||||
|
DBGPRINTF("Called action %p (complex case), logging to %s\n",
|
||||||
|
pAction, module.GetStateName(pAction->pMod));
|
||||||
|
|
||||||
|
pAction->tActNow = -1; /* we do not yet know our current time (clear prev. value) */
|
||||||
|
// TODO: can we optimize the "now" handling again (was batch, I guess...)?
|
||||||
|
|
||||||
|
/* don't output marks to recently written outputs */
|
||||||
|
if(pAction->bWriteAllMarkMsgs == RSFALSE
|
||||||
|
&& (pMsg->msgFlags & MARK) && (getActNow(pAction) - pAction->f_time) < MarkInterval / 2) {
|
||||||
|
ABORT_FINALIZE(RS_RET_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* call the output driver */
|
||||||
|
iRet = actionWriteToAction(pAction, pMsg, pWti);
|
||||||
|
|
||||||
|
finalize_it:
|
||||||
|
d_pthread_mutex_unlock(&pAction->mutAction);
|
||||||
|
pthread_cleanup_pop(0); /* remove mutex cleanup handler */
|
||||||
|
|
||||||
|
RETiRet;
|
||||||
|
}
|
||||||
|
#pragma GCC diagnostic warning "-Wempty-body"
|
||||||
|
|
||||||
|
|
||||||
/* helper to activateActions, it activates a specific action.
|
/* helper to activateActions, it activates a specific action.
|
||||||
*/
|
*/
|
||||||
DEFFUNC_llExecFunc(doActivateActions)
|
DEFFUNC_llExecFunc(doActivateActions)
|
||||||
@ -1362,41 +1397,6 @@ doSubmitToActionQNotAllMark(action_t *pAction, wti_t *pWti, msg_t *pMsg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Call configured action, most complex case with all features supported (and thus slow).
|
|
||||||
* rgerhards, 2010-06-08
|
|
||||||
*/
|
|
||||||
#pragma GCC diagnostic ignored "-Wempty-body"
|
|
||||||
static rsRetVal
|
|
||||||
doSubmitToActionQComplex(action_t *pAction, wti_t *pWti, msg_t *pMsg)
|
|
||||||
{
|
|
||||||
DEFiRet;
|
|
||||||
|
|
||||||
d_pthread_mutex_lock(&pAction->mutAction);
|
|
||||||
pthread_cleanup_push(mutexCancelCleanup, &pAction->mutAction);
|
|
||||||
DBGPRINTF("Called action %p (complex case), logging to %s\n",
|
|
||||||
pAction, module.GetStateName(pAction->pMod));
|
|
||||||
|
|
||||||
pAction->tActNow = -1; /* we do not yet know our current time (clear prev. value) */
|
|
||||||
// TODO: can we optimize the "now" handling again (was batch, I guess...)?
|
|
||||||
|
|
||||||
/* don't output marks to recently written outputs */
|
|
||||||
if(pAction->bWriteAllMarkMsgs == RSFALSE
|
|
||||||
&& (pMsg->msgFlags & MARK) && (getActNow(pAction) - pAction->f_time) < MarkInterval / 2) {
|
|
||||||
ABORT_FINALIZE(RS_RET_OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* call the output driver */
|
|
||||||
iRet = actionWriteToAction(pAction, pMsg, pWti);
|
|
||||||
|
|
||||||
finalize_it:
|
|
||||||
d_pthread_mutex_unlock(&pAction->mutAction);
|
|
||||||
pthread_cleanup_pop(0); /* remove mutex cleanup handler */
|
|
||||||
|
|
||||||
RETiRet;
|
|
||||||
}
|
|
||||||
#pragma GCC diagnostic warning "-Wempty-body"
|
|
||||||
|
|
||||||
|
|
||||||
/* apply all params from param block to action. This supports the v6 config system.
|
/* apply all params from param block to action. This supports the v6 config system.
|
||||||
* Defaults must have been set appropriately during action construct!
|
* Defaults must have been set appropriately during action construct!
|
||||||
* rgerhards, 2011-08-01
|
* rgerhards, 2011-08-01
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user