diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-11 11:33:16 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-11 11:33:16 +0200 |
commit | 3421209cd550b9470c218a4cda578b7aad42529f (patch) | |
tree | 95b59136e0cc64ec28ca27a20660380a5f06ad99 /runtime/msg.c | |
parent | 71a14055adfaa2a43cb1cf0c6d3c05acb6ed1ef0 (diff) | |
download | rsyslog-3421209cd550b9470c218a4cda578b7aad42529f.tar.gz rsyslog-3421209cd550b9470c218a4cda578b7aad42529f.tar.bz2 rsyslog-3421209cd550b9470c218a4cda578b7aad42529f.zip |
optimize property replacer: reduce runtime for simple processing
Diffstat (limited to 'runtime/msg.c')
-rw-r--r-- | runtime/msg.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index 09ee59e2..b79e4756 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -2912,7 +2912,7 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, } /* If we did not receive a template pointer, we are already done... */ - if(pTpe == NULL) { + if(pTpe == NULL || !pTpe->bComplexProcessing) { *pPropLen = (bufLen == -1) ? ustrlen(pRes) : bufLen; return pRes; } @@ -3499,9 +3499,7 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, jsonField(pTpe, &pRes, pbMustBeFreed, &bufLen); } - if(bufLen == -1) - bufLen = ustrlen(pRes); - *pPropLen = bufLen; + *pPropLen = (bufLen == -1) ? ustrlen(pRes) : bufLen; ENDfunc return(pRes); |