diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-04 16:52:56 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-04 16:52:56 +0000 |
commit | e41c0854dac685047dba1107b097bf674e740131 (patch) | |
tree | b0257b48b40e707b65a1c3ec02de42d95928b45d | |
parent | 3b8457d1da7f81f9d5c48ff9f1d84cb838942803 (diff) | |
download | rsyslog-e41c0854dac685047dba1107b097bf674e740131.tar.gz rsyslog-e41c0854dac685047dba1107b097bf674e740131.tar.xz rsyslog-e41c0854dac685047dba1107b097bf674e740131.zip |
moved message destruction back to consumer - the consume should decide what
to do with the object. It may pass it on to someone else. So this would
have creatd some headache in the future (maybe...).
-rw-r--r-- | msg.c | 2 | ||||
-rw-r--r-- | queue.c | 5 | ||||
-rw-r--r-- | syslogd.c | 7 |
3 files changed, 1 insertions, 13 deletions
@@ -135,11 +135,9 @@ msg_t* MsgConstruct(void) rsRetVal MsgDestruct(msg_t * pM) { assert(pM != NULL); - dbgprintf("MsgDestruct\t0x%lx, Ref now: %d\n", (unsigned long)pM, pM->iRefCount - 1); /* DEV Debugging only ! dbgprintf("MsgDestruct\t0x%lx, Ref now: %d\n", (unsigned long)pM, pM->iRefCount - 1); */ if(--pM->iRefCount == 0) { - dbgprintf("MsgDestruct\t0x%lx, RefCount now 0, doing DESTROY\n", (unsigned long)pM); /* DEV Debugging Only! dbgprintf("MsgDestruct\t0x%lx, RefCount now 0, doing DESTROY\n", (unsigned long)pM); */ if(pM->pszUxTradMsg != NULL) free(pM->pszUxTradMsg); @@ -343,11 +343,6 @@ queueWorker(void *arg) if(iRetLocal != RS_RET_OK) dbgprintf("Queue 0x%lx: Consumer returned iRet %d\n", (unsigned long) pThis, iRetLocal); -dbgprintf("QUEUE: consumer done\n"); - iRetLocal = objDestruct(pUsr); - if(iRetLocal != RS_RET_OK) - dbgprintf("Queue 0x%lx: Destructor returned iRet %d\n", - (unsigned long) pThis, iRetLocal); } else { dbgprintf("Queue 0x%lx: error %d dequeueing element - ignoring, but strange things " "may happen\n", (unsigned long) pThis, iRet); @@ -1868,6 +1868,7 @@ msgConsumer(void *pUsr) assert(pMsg != NULL); processMsg(pMsg); + MsgDestruct(pMsg); return RS_RET_OK; } @@ -2339,12 +2340,6 @@ logmsg(int pri, msg_t *pMsg, int flags) pMsg->msgFlags = flags; queueEnqObj(pMsgQueue, (void*) pMsg); -#if 0 - CHKiRet_Hdlr(queueEnqObj(pMsgQueue, (void*) pMsg)) { - /* if we have an error return, the pMsg was not destructed */ - MsgDestruct(pMsg); - } -#endif } |