diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-05 11:49:32 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-05 11:49:32 +0100 |
commit | c4f14fa28cc24cc56104b4b89ad380ee0f0470d3 (patch) | |
tree | ae55c499426c23bf0a395e1f6dfe8b0a06822b90 /runtime/ruleset.c | |
parent | a734fe1378c727cb779a0e5e84599aaf6277bbf9 (diff) | |
parent | 9052857047f0cb67ef7b2fe1519120bf37ba2648 (diff) | |
download | rsyslog-c4f14fa28cc24cc56104b4b89ad380ee0f0470d3.tar.gz rsyslog-c4f14fa28cc24cc56104b4b89ad380ee0f0470d3.tar.bz2 rsyslog-c4f14fa28cc24cc56104b4b89ad380ee0f0470d3.zip |
Merge branch 'master-ruleeng' into master-ruleeng-simd
Conflicts:
runtime/ruleset.c
required refactoring of (asnyc) call code
Diffstat (limited to 'runtime/ruleset.c')
-rw-r--r-- | runtime/ruleset.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/runtime/ruleset.c b/runtime/ruleset.c index 5f9b500e..4ac0039a 100644 --- a/runtime/ruleset.c +++ b/runtime/ruleset.c @@ -188,6 +188,26 @@ execUnset(struct cnfstmt *stmt, msg_t *pMsg) msgDelJSON(pMsg, stmt->d.s_unset.varname); } +static rsRetVal +execCall(struct cnfstmt *stmt, msg_t *pMsg, wti_t *pWti) +{ + DEFiRet; + if(stmt->d.s_call.ruleset == NULL) { + scriptExec(stmt->d.s_call.stmt, pMsg, pWti); + } else { + CHKmalloc(pMsg = MsgDup((msg_t*) pMsg)); + DBGPRINTF("CALL: forwarding message to async ruleset %p\n", + stmt->d.s_call.ruleset->pQueue); + MsgSetFlowControlType(pMsg, eFLOWCTL_NO_DELAY); + MsgSetRuleset(pMsg, stmt->d.s_call.ruleset); + /* Note: we intentionally use submitMsg2() here, as we process messages + * that were already run through the rate-limiter. + */ + submitMsg2(pMsg); + } +finalize_it: + RETiRet; +} static void execIf(struct cnfstmt *stmt, msg_t *pMsg, wti_t *pWti) @@ -364,7 +384,7 @@ scriptExec(struct cnfstmt *root, msg_t *pMsg, wti_t *pWti) execUnset(stmt, pMsg); break; case S_CALL: - scriptExec(stmt->d.s_call.stmt, pMsg, pWti); + execCall(stmt, pMsg, pWti); break; case S_IF: execIf(stmt, pMsg, pWti); |