summaryrefslogtreecommitdiffstats
path: root/runtime/parser.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-04-19 17:03:08 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2010-04-19 17:03:08 +0200
commit587036bfb03167d86b0a2fbfe998db1a916cabb3 (patch)
tree6119d231b6dc5b6f3d7be1cc07cbe05556128d99 /runtime/parser.c
parent393c67ba5bc20613436552a26a6f0a20d4dda9fe (diff)
downloadrsyslog-587036bfb03167d86b0a2fbfe998db1a916cabb3.tar.gz
rsyslog-587036bfb03167d86b0a2fbfe998db1a916cabb3.tar.xz
rsyslog-587036bfb03167d86b0a2fbfe998db1a916cabb3.zip
changed imsolaris to use submitMsg() API
This includes a modification to the rsyslog engine so that messages without PRI inside the message can properly be handled.
Diffstat (limited to 'runtime/parser.c')
-rw-r--r--runtime/parser.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/runtime/parser.c b/runtime/parser.c
index 36e88ebd..810bf42b 100644
--- a/runtime/parser.c
+++ b/runtime/parser.c
@@ -287,19 +287,24 @@ rsRetVal parseMsg(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);