summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-11-20 14:10:08 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-11-20 14:10:08 +0100
commit89030a107ef46286196d7ffae8e992138bbd7e69 (patch)
tree1346b4fdb91e55bf1a50b84fbc49df1e9b7466aa
parentb8f839de86a29924a3b4b16d36f6cc7331a4a2d4 (diff)
downloadrsyslog-89030a107ef46286196d7ffae8e992138bbd7e69.tar.gz
rsyslog-89030a107ef46286196d7ffae8e992138bbd7e69.tar.bz2
rsyslog-89030a107ef46286196d7ffae8e992138bbd7e69.zip
bugfix: RainerScript optimizer did not optimize PRI filters
things like "if $syslogfacility-text == "local3"" were not converted to PRIFILT. This was a regression introduced in 7.5.6.
-rw-r--r--ChangeLog3
-rw-r--r--grammar/rainerscript.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7cddf587..53625056 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@ Version 7.5.7 [v7-devel] 2013-11-??
* high water mark is now dynamically 90% of queue size
* low water makr is now dynamically 70% of queue size
* queue.workerThreadMinimumMessage set to queue.size / num workers
+- bugfix: RainerScript optimizer did not optimize PRI filters
+ things like "if $syslogfacility-text == "local3"" were not converted
+ to PRIFILT. This was a regression introduced in 7.5.6.
- bugfix: legacy directive $ActionQueueWorkerThreads was not honored
- bugfix: segfault on startup when certain script constructs are used
e.g. "if not $msg ..."
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index ecc23b54..e4f85860 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -2884,7 +2884,7 @@ cnfexprOptimize_CMP_severity_facility(struct cnfexpr *expr)
if(expr->l->nodetype != 'V')
FINALIZE;
- if(!strcmp("$syslogseverity", ((struct cnfvar*)expr->l)->name)) {
+ if(!strcmp("syslogseverity", ((struct cnfvar*)expr->l)->name)) {
if(expr->r->nodetype == 'N') {
int sev = (int) ((struct cnfnumval*)expr->r)->val;
if(sev >= 0 && sev <= 7) {
@@ -2898,7 +2898,7 @@ cnfexprOptimize_CMP_severity_facility(struct cnfexpr *expr)
"evaluate to FALSE", sev);
}
}
- } else if(!strcmp("$syslogfacility", ((struct cnfvar*)expr->l)->name)) {
+ } else if(!strcmp("syslogfacility", ((struct cnfvar*)expr->l)->name)) {
if(expr->r->nodetype == 'N') {
int fac = (int) ((struct cnfnumval*)expr->r)->val;
if(fac >= 0 && fac <= 24) {
@@ -2926,7 +2926,7 @@ cnfexprOptimize_CMP_var(struct cnfexpr *expr)
{
struct cnffunc *func;
- if(!strcmp("$syslogfacility-text", ((struct cnfvar*)expr->l)->name)) {
+ if(!strcmp("syslogfacility-text", ((struct cnfvar*)expr->l)->name)) {
if(expr->r->nodetype == 'S') {
char *cstr = es_str2cstr(((struct cnfstringval*)expr->r)->estr, NULL);
int fac = decodeSyslogName((uchar*)cstr, syslogFacNames);
@@ -2944,7 +2944,7 @@ cnfexprOptimize_CMP_var(struct cnfexpr *expr)
}
free(cstr);
}
- } else if(!strcmp("$syslogseverity-text", ((struct cnfvar*)expr->l)->name)) {
+ } else if(!strcmp("syslogseverity-text", ((struct cnfvar*)expr->l)->name)) {
if(expr->r->nodetype == 'S') {
char *cstr = es_str2cstr(((struct cnfstringval*)expr->r)->estr, NULL);
int sev = decodeSyslogName((uchar*)cstr, syslogPriNames);