diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-26 11:16:32 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-26 11:16:32 +0200 |
commit | 696c084e51ce49dc4a3f70642df469712eed8de6 (patch) | |
tree | 5272e38099c6eb5fada9bab61487950fe32520ac /runtime/ruleset.c | |
parent | 752e1c4b863346fe6eb8b6bc66d1d3bc3d346d13 (diff) | |
download | rsyslog-696c084e51ce49dc4a3f70642df469712eed8de6.tar.gz rsyslog-696c084e51ce49dc4a3f70642df469712eed8de6.tar.bz2 rsyslog-696c084e51ce49dc4a3f70642df469712eed8de6.zip |
bugfix: call to ruleset with async queue did not use the queue
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=443
Diffstat (limited to 'runtime/ruleset.c')
-rw-r--r-- | runtime/ruleset.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/runtime/ruleset.c b/runtime/ruleset.c index e3348938..cbfd847a 100644 --- a/runtime/ruleset.c +++ b/runtime/ruleset.c @@ -284,6 +284,30 @@ execStop(batch_t *pBatch, sbool *active) } RETiRet; } +static rsRetVal +execCall(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) +{ + msg_t *pMsg; + int i; + DEFiRet; + if(stmt->d.s_call.ruleset == NULL) { + scriptExec(stmt->d.s_call.stmt, pBatch, active); + } else { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + CHKmalloc(pMsg = MsgDup((msg_t*) pBatch->pElem[i].pMsg)); + DBGPRINTF("CALL: forwarding message %d to async ruleset %p\n", + i, 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; +} /* for details, see scriptExec() header comment! */ // save current filter, evaluate new one @@ -535,7 +559,7 @@ scriptExec(struct cnfstmt *root, batch_t *pBatch, sbool *active) execUnset(stmt, pBatch, active); break; case S_CALL: - scriptExec(stmt->d.s_call.stmt, pBatch, active); + execCall(stmt, pBatch, active); break; case S_IF: execIf(stmt, pBatch, active); |