summaryrefslogtreecommitdiffstats
path: root/runtime/parser.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-09-07 15:38:57 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-09-07 15:38:57 +0200
commit11ee5cbdfb08ba3e42a853c08144fa24cd55d6da (patch)
treeeb981082bfe83c80b74149a1927ff0470b70db62 /runtime/parser.c
parent76c9616612a23796349a42d9b236a1cb0b836133 (diff)
parent156d3f64e7ce50a570c1f8f95f51406c4853aad8 (diff)
downloadrsyslog-df72a36023708c3181553d192c138c95dcee9d52.tar.gz
rsyslog-df72a36023708c3181553d192c138c95dcee9d52.tar.xz
rsyslog-df72a36023708c3181553d192c138c95dcee9d52.zip
Merge branch 'v4-beta' into v4-stable, prep for 4.8.0v4.8.0
There are no changes compared to 4.7.5, just a re-release with the new version number as new v4-stable. The most important new feature is Solaris support. Conflicts: configure.ac doc/manual.html
Diffstat (limited to 'runtime/parser.c')
-rw-r--r--runtime/parser.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/runtime/parser.c b/runtime/parser.c
index d27f3e38..be9304d7 100644
--- a/runtime/parser.c
+++ b/runtime/parser.c
@@ -285,23 +285,28 @@ rsRetVal parseMsg(msg_t *pMsg)
lenMsg = pMsg->iLenRawMsg;
msg = pMsg->pszRawMsg;
pri = DEFUPRI;
- 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);
+ MsgSetAfterPRIOffs(pMsg, msg - pMsg->pszRawMsg);
}
- pMsg->iFacility = LOG_FAC(pri);
- pMsg->iSeverity = LOG_PRI(pri);
- MsgSetAfterPRIOffs(pMsg, msg - pMsg->pszRawMsg);
/* rger 2005-11-24 (happy thanksgiving!): we now need to check if we have
* a traditional syslog message or one formatted according to syslog-protocol.