diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | plugins/omrelp/omrelp.c | 25 |
2 files changed, 27 insertions, 1 deletions
@@ -1,7 +1,8 @@ --------------------------------------------------------------------------- Version 7.5.2 [devel] 2013-0?-?? - librelp 1.1.4 is now required - We use API extensions for better error reporting. + We use API extensions for better error reporting and higher performance. +- omrelp: use transactional mode to make imrelp emit bulk sends - doc: fixed various typos closes: http://bugzilla.adiscon.com/show_bug.cgi?id=391 Thanks to Georgi Georgiev for the patch. diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c index bc27b402..d41b46a6 100644 --- a/plugins/omrelp/omrelp.c +++ b/plugins/omrelp/omrelp.c @@ -375,6 +375,16 @@ finalize_it: RETiRet; } +BEGINbeginTransaction +CODESTARTbeginTransaction +dbgprintf("omrelp: beginTransaction\n"); + if(!pData->bIsConnected) { + CHKiRet(doConnect(pData)); + } + relpCltHintBurstBegin(pData->pRelpClt); +finalize_it: +ENDbeginTransaction + BEGINdoAction uchar *pMsg; /* temporary buffering */ size_t lenMsg; @@ -408,9 +418,23 @@ CODESTARTdoAction finalize_it: if(pData->bHadAuthFail) iRet = RS_RET_DISABLE_ACTION; + if(iRet == RS_RET_OK) { + /* we mimic non-commit, as otherwise our endTransaction handler + * will not get called. While this is not 100% correct, the worst + * that can happen is some message duplication, something that + * rsyslog generally accepts and prefers over message loss. + */ + iRet = RS_RET_PREVIOUS_COMMITTED; + } ENDdoAction +BEGINendTransaction +CODESTARTendTransaction + dbgprintf("omrelp: endTransaction\n"); + relpCltHintBurstEnd(pData->pRelpClt); +ENDendTransaction + BEGINparseSelectorAct uchar *q; int i; @@ -508,6 +532,7 @@ CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES +CODEqueryEtryPt_TXIF_OMOD_QUERIES CODEqueryEtryPt_SetShutdownImmdtPtr ENDqueryEtryPt |