~ubuntu-branches/debian/sid/rsyslog/sid

« back to all changes in this revision

Viewing changes to runtime/ratelimit.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Michael Biebl, Daniel Pocock
  • Date: 2014-03-11 19:52:49 UTC
  • mfrom: (1.1.37)
  • Revision ID: package-import@ubuntu.com-20140311195249-phbsh9be8lebawti
Tags: 7.4.8-1
[ Michael Biebl ]
* New upstream release.
* Update Build-Depends:
  - Bump libestr-dev to (>= 0.1.9).
  - Tighten liblognorm-dev to (<< 1.0.0).
  - Replace libjson0-dev with libjson-c-dev, we no longer need the
    transitional package.
* Bump Standards-Version to 3.9.5. No further changes.

[ Daniel Pocock ]
* Make template parameter not mandatory in mongodb output plugin. Patch
  cherry-picked from upstream Git. (Closes: #740869, #721277)
* Ensure JSON templates are NUL terminated. Patch cherry-picked from
  upstream Git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
doLastMessageRepeatedNTimes(ratelimit_t *ratelimit, msg_t *pMsg, msg_t **ppRepMsg)
74
74
{
75
75
        int bNeedUnlockMutex = 0;
76
 
        rsRetVal localRet;
77
76
        DEFiRet;
78
77
 
79
 
        if((pMsg->msgFlags & NEEDS_PARSING) != 0) {
80
 
                if((localRet = parser.ParseMsg(pMsg)) != RS_RET_OK)  {
81
 
                        DBGPRINTF("Message discarded, parsing error %d\n", localRet);
82
 
                        ABORT_FINALIZE(RS_RET_DISCARDMSG);
83
 
                }
84
 
        }
85
 
 
86
78
        if(ratelimit->bThreadSafe) {
87
79
                pthread_mutex_lock(&ratelimit->mut);
88
80
                bNeedUnlockMutex = 1;
209
201
ratelimitMsg(ratelimit_t *ratelimit, msg_t *pMsg, msg_t **ppRepMsg)
210
202
{
211
203
        DEFiRet;
 
204
        rsRetVal localRet;
 
205
 
 
206
        if((pMsg->msgFlags & NEEDS_PARSING) != 0) {
 
207
                if((localRet = parser.ParseMsg(pMsg)) != RS_RET_OK)  {
 
208
                        DBGPRINTF("Message discarded, parsing error %d\n", localRet);
 
209
                        ABORT_FINALIZE(RS_RET_DISCARDMSG);
 
210
                }
 
211
        }
212
212
 
213
213
        *ppRepMsg = NULL;
214
214
        /* Only the messages having severity level at or below the
223
223
                CHKiRet(doLastMessageRepeatedNTimes(ratelimit, pMsg, ppRepMsg));
224
224
        }
225
225
finalize_it:
 
226
        if(Debug) {
 
227
                if(iRet == RS_RET_DISCARDMSG)
 
228
                        dbgprintf("message discarded by ratelimiting\n");
 
229
        }
226
230
        RETiRet;
227
231
}
228
232