diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-12 13:58:49 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-12 13:58:49 +0000 |
commit | 2d9239beca678e35b8dc6e09e4add721052bfcb8 (patch) | |
tree | 96689305884dae4ff75bea6324b353c4f5756ee9 | |
parent | bc846dc0bddbf0f95c1354927adcb5daaf41ef4c (diff) | |
download | rsyslog-2d9239beca678e35b8dc6e09e4add721052bfcb8.tar.gz rsyslog-2d9239beca678e35b8dc6e09e4add721052bfcb8.tar.xz rsyslog-2d9239beca678e35b8dc6e09e4add721052bfcb8.zip |
bugfix: discard action and backup actions did not work due to problem in
direct queue mode. Now fixed. Tracker was
http://sourceforge.net/tracker/index.php?func=detail&aid=1886931&group_
id=123448&atid=696552
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | action.c | 1 | ||||
-rw-r--r-- | omdiscard.c | 1 | ||||
-rw-r--r-- | queue.c | 29 | ||||
-rw-r--r-- | syslogd.c | 8 |
5 files changed, 25 insertions, 17 deletions
@@ -16,6 +16,9 @@ Version 3.11.1 (rgerhards), 2008-02-12 Thanks to Anders Blomdell fro bringing this to our attention - somewhat improved performance of string buffers - fixed bug that caused invalid treatment of tabs (HT) in rsyslog.conf +- bugfix: setting for $EscapeCopntrolCharactersOnReceive was not + properly initialized +- clarified usage of space-cc property replacer option --------------------------------------------------------------------------- Version 3.11.0 (rgerhards), 2008-01-31 - implemented queued actions @@ -520,6 +520,7 @@ actionWriteToAction(action_t *pAction) * So let's enqueue our message for execution. -- rgerhards, 2007-07-24 */ iRet = queueEnqObj(pAction->pQueue, (void*) MsgAddRef(pAction->f_pMsg)); +RUNLOG_VAR("%d", iRet); if(iRet == RS_RET_OK) pAction->f_prevcount = 0; /* message processed, so we start a new cycle */ diff --git a/omdiscard.c b/omdiscard.c index 26d5f3da..0f99b5fd 100644 --- a/omdiscard.c +++ b/omdiscard.c @@ -71,6 +71,7 @@ ENDtryResume BEGINdoAction CODESTARTdoAction + dbgprintf("\n"); iRet = RS_RET_DISCARDMSG; ENDdoAction @@ -890,19 +890,16 @@ static rsRetVal qDestructDirect(queue_t __attribute__((unused)) *pThis) static rsRetVal qAddDirect(queue_t *pThis, void* pUsr) { DEFiRet; - rsRetVal iRetLocal; ASSERT(pThis != NULL); /* calling the consumer is quite different here than it is from a worker thread */ - iRetLocal = pThis->pConsumer(pThis->pUsr, pUsr); - if(iRetLocal != RS_RET_OK) { - dbgoprint((obj_t*) pThis, "Consumer returned iRet %d\n", iRetLocal); - } - --pThis->iQueueSize; /* this is kind of a hack, but its the smartest thing we can do given - * the somewhat astonishing fact that this queue type does not actually - * queue anything ;) - */ + /* we need to provide the consumer's return value back to the caller because in direct + * mode the consumer probably has a lot to convey (which get's lost in the other modes + * because they are asynchronous. But direct mode is deliberately synchronous. + * rgerhards, 2008-02-12 + */ + iRet = pThis->pConsumer(pThis->pUsr, pUsr); RETiRet; } @@ -963,18 +960,24 @@ queueGetUngottenObj(queue_t *pThis, obj_t **ppUsr) } -/* generic code to add a queue entry */ +/* generic code to add a queue entry + * We use some specific code to most efficiently support direct mode + * queues. This is justified in spite of the gain and the need to do some + * things truely different. -- rgerhards, 2008-02-12 + */ static rsRetVal queueAdd(queue_t *pThis, void *pUsr) { DEFiRet; ASSERT(pThis != NULL); - CHKiRet(pThis->qAdd(pThis, pUsr)); - ++pThis->iQueueSize; + CHKiRet(pThis->qAdd(pThis, pUsr)); - dbgoprint((obj_t*) pThis, "entry added, size now %d entries\n", pThis->iQueueSize); + if(pThis->qType != QUEUETYPE_DIRECT) { + ++pThis->iQueueSize; + dbgoprint((obj_t*) pThis, "entry added, size now %d entries\n", pThis->iQueueSize); + } finalize_it: RETiRet; @@ -1645,12 +1645,12 @@ int shouldProcessThisMessage(selector_t *f, msg_t *pMsg) iRet = (iRet == 1) ? 0 : 1; if(Debug) { - printf("Filter: check for property '%s' (value '%s') ", + dbgprintf("Filter: check for property '%s' (value '%s') ", rsCStrGetSzStrNoNULL(f->f_filterData.prop.pCSPropName), pszPropVal); if(f->f_filterData.prop.isNegated) - printf("NOT "); - printf("%s '%s': %s\n", + dbgprintf("NOT "); + dbgprintf("%s '%s': %s\n", getFIOPName(f->f_filterData.prop.operation), rsCStrGetSzStrNoNULL(f->f_filterData.prop.pCSCompValue), iRet ? "TRUE" : "FALSE"); @@ -2893,7 +2893,7 @@ DEFFUNC_llExecFunc(dbgPrintInitInfoAction) { DEFiRet; iRet = actionDbgPrint((action_t*) pData); - printf("\n"); + dbgprintf("\n"); RETiRet; } |