summaryrefslogtreecommitdiffstats
path: root/plugins/mmnormalize/mmnormalize.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-11-25 14:45:33 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-11-25 14:45:33 +0100
commited3e129c21305799dac17137f03786adb539bc57 (patch)
treeb389ee00aee717a49dc7bbf0e49567bfbed09a9d /plugins/mmnormalize/mmnormalize.c
parent1d60fefd8832c97e55a87b1ee73dcd059e87c5c0 (diff)
downloadrsyslog-ed3e129c21305799dac17137f03786adb539bc57.tar.gz
rsyslog-ed3e129c21305799dac17137f03786adb539bc57.tar.bz2
rsyslog-ed3e129c21305799dac17137f03786adb539bc57.zip
mmnormalize: no longer need to duplicate msg text for liblognorm
as liblognorm's interface has been changed to support traditional C strings
Diffstat (limited to 'plugins/mmnormalize/mmnormalize.c')
-rw-r--r--plugins/mmnormalize/mmnormalize.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/plugins/mmnormalize/mmnormalize.c b/plugins/mmnormalize/mmnormalize.c
index 613f002d..a8c436fa 100644
--- a/plugins/mmnormalize/mmnormalize.c
+++ b/plugins/mmnormalize/mmnormalize.c
@@ -195,32 +195,25 @@ ENDtryResume
BEGINdoAction
msg_t *pMsg;
- es_str_t *str;
uchar *buf;
int len;
int r;
struct json_object *json = NULL;
CODESTARTdoAction
pMsg = (msg_t*) ppString[0];
- /* note that we can performance-optimize the interface, but this also
- * requires changes to the libraries. For now, we accept message
- * duplication. -- rgerhards, 2010-12-01
- */
if(pWrkrData->pData->bUseRawMsg) {
getRawMsg(pMsg, &buf, &len);
} else {
buf = getMSG(pMsg);
len = getMSGLen(pMsg);
}
- str = es_newStrFromCStr((char*)buf, len);
- r = ln_normalize(pWrkrData->pData->ctxln, str, &json);
+ r = ln_normalize(pWrkrData->pData->ctxln, buf, len, &json);
if(r != 0) {
DBGPRINTF("error %d during ln_normalize\n", r);
MsgSetParseSuccess(pMsg, 0);
} else {
MsgSetParseSuccess(pMsg, 1);
}
- es_deleteStr(str);
msgAddJSON(pMsg, (uchar*)pWrkrData->pData->pszPath + 1, json);