diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-09 17:19:21 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-09 17:19:21 +0200 |
commit | 6fde78cb744b22eb5790d43297acab249ca0e7fa (patch) | |
tree | 290dea7d09efc76e92eb18329f05913f1918957e /runtime/rule.c | |
parent | ab40107149038898ef24479a6911d9cd7770a56c (diff) | |
download | rsyslog-6fde78cb744b22eb5790d43297acab249ca0e7fa.tar.gz rsyslog-6fde78cb744b22eb5790d43297acab249ca0e7fa.tar.xz rsyslog-6fde78cb744b22eb5790d43297acab249ca0e7fa.zip |
small performance improvement and cleanup
optimized substring processing, should bring a small enhancement when
forwarding with the default forwarding templates. Also did some uchar
cleanup in msg.c (thus so many changes, in reality they are few...).
Diffstat (limited to 'runtime/rule.c')
-rw-r--r-- | runtime/rule.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/rule.c b/runtime/rule.c index 3a257a90..182d616a 100644 --- a/runtime/rule.c +++ b/runtime/rule.c @@ -39,6 +39,7 @@ #include "vm.h" #include "var.h" #include "srUtils.h" +#include "unicode-helper.h" #include "dirty.h" /* for getFIOPName */ /* static data */ @@ -104,7 +105,7 @@ shouldProcessThisMessage(rule_t *pRule, msg_t *pMsg, int *bProcessMsg) { DEFiRet; unsigned short pbMustBeFreed; - char *pszPropVal; + uchar *pszPropVal; int bRet = 0; size_t propLen; vm_t *pVM = NULL; @@ -189,12 +190,12 @@ shouldProcessThisMessage(rule_t *pRule, msg_t *pMsg, int *bProcessMsg) break; case FIOP_ISEQUAL: if(rsCStrSzStrCmp(pRule->f_filterData.prop.pCSCompValue, - (uchar*) pszPropVal, strlen(pszPropVal)) == 0) + pszPropVal, ustrlen(pszPropVal)) == 0) bRet = 1; /* process message! */ break; case FIOP_STARTSWITH: if(rsCStrSzStrStartsWithCStr(pRule->f_filterData.prop.pCSCompValue, - (uchar*) pszPropVal, strlen(pszPropVal)) == 0) + pszPropVal, ustrlen(pszPropVal)) == 0) bRet = 1; /* process message! */ break; case FIOP_REGEX: |