diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-04-19 17:13:08 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-04-19 17:13:08 +0200 |
commit | d3eb89a5fe1dbcda028c0ab5e6753578716539d7 (patch) | |
tree | 9a6da2266542fb772bc996b6d245403ecdfd126c /runtime | |
parent | 4e511087c413629120315fe5dd26f966ac1ef6fb (diff) | |
parent | 587036bfb03167d86b0a2fbfe998db1a916cabb3 (diff) | |
download | rsyslog-d3eb89a5fe1dbcda028c0ab5e6753578716539d7.tar.gz rsyslog-d3eb89a5fe1dbcda028c0ab5e6753578716539d7.tar.xz rsyslog-d3eb89a5fe1dbcda028c0ab5e6753578716539d7.zip |
Merge branch 'v4-devel' into master
Conflicts:
runtime/msg.h
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/msg.h | 1 | ||||
-rw-r--r-- | runtime/parser.c | 29 |
2 files changed, 18 insertions, 12 deletions
diff --git a/runtime/msg.h b/runtime/msg.h index b4b6d9f8..712609f6 100644 --- a/runtime/msg.h +++ b/runtime/msg.h @@ -129,6 +129,7 @@ struct msg { #define PARSE_HOSTNAME 0x020 /* parse the hostname during message parsing */ #define NEEDS_DNSRESOL 0x040 /* fromhost address is unresolved and must be locked up via DNS reverse lookup first */ #define NEEDS_ACLCHK_U 0x080 /* check UDP ACLs after DNS resolution has been done in main queue consumer */ +#define NO_PRI_IN_RAW 0x100 /* rawmsg does not include a PRI (Solaris!), but PRI is already set correctly in the msg object */ /* function prototypes diff --git a/runtime/parser.c b/runtime/parser.c index 6238fa64..c85750dc 100644 --- a/runtime/parser.c +++ b/runtime/parser.c @@ -437,19 +437,24 @@ ParsePRI(msg_t *pMsg) msg = pMsg->pszRawMsg; pri = DEFUPRI; iPriText = 0; - if(*msg == '<') { - /* while we process the PRI, we also fill the PRI textual representation - * inside the msg object. This may not be ideal from an OOP point of view, - * but it offers us performance... - */ - pri = 0; - while(--lenMsg > 0 && isdigit((int) *++msg)) { - pri = 10 * pri + (*msg - '0'); + if(pMsg->msgFlags & NO_PRI_IN_RAW) { + /* In this case, simply do so as if the pri would be right at top */ + MsgSetAfterPRIOffs(pMsg, 0); + } else { + if(*msg == '<') { + /* while we process the PRI, we also fill the PRI textual representation + * inside the msg object. This may not be ideal from an OOP point of view, + * but it offers us performance... + */ + pri = 0; + while(--lenMsg > 0 && isdigit((int) *++msg)) { + pri = 10 * pri + (*msg - '0'); + } + if(*msg == '>') + ++msg; + if(pri & ~(LOG_FACMASK|LOG_PRIMASK)) + pri = DEFUPRI; } - if(*msg == '>') - ++msg; - if(pri & ~(LOG_FACMASK|LOG_PRIMASK)) - pri = DEFUPRI; } pMsg->iFacility = LOG_FAC(pri); pMsg->iSeverity = LOG_PRI(pri); |