diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-29 11:26:42 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-29 11:26:42 +0200 |
commit | ed623752dda20002dc081ddb24e41473ae27dada (patch) | |
tree | 1355b2686073076bbec32be9290e92c469bdb793 /plugins/omrelp/omrelp.c | |
parent | 2748f0bec7ea3bdf52718ec5a519ed2819d6a479 (diff) | |
download | rsyslog-ed623752dda20002dc081ddb24e41473ae27dada.tar.gz rsyslog-ed623752dda20002dc081ddb24e41473ae27dada.tar.bz2 rsyslog-ed623752dda20002dc081ddb24e41473ae27dada.zip |
omrelp: use transactional mode to make imrelp emit bulk sends
Diffstat (limited to 'plugins/omrelp/omrelp.c')
-rw-r--r-- | plugins/omrelp/omrelp.c | 25 |
1 files changed, 25 insertions, 0 deletions
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 |