summaryrefslogtreecommitdiffstats
path: root/tools/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-16 12:31:27 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-16 12:31:27 +0200
commit74b2b24f508be90d20961304d5e3cce648f3eb7c (patch)
treeb2575e22c7b6b0ced97b125c7e67417a6bbb92e6 /tools/syslogd.c
parentf7579e68a67364c8040966be57c2eae4c9550ee5 (diff)
downloadrsyslog-74b2b24f508be90d20961304d5e3cce648f3eb7c.tar.gz
rsyslog-74b2b24f508be90d20961304d5e3cce648f3eb7c.tar.xz
rsyslog-74b2b24f508be90d20961304d5e3cce648f3eb7c.zip
removed long-obsoleted property UxTradMsg
... as well as some cleanup (some commented-out code is left to support UxTradMsg again is someone really complains ;)).
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r--tools/syslogd.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index c224087d..2f06d273 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -670,16 +670,9 @@ static inline rsRetVal printline(uchar *hname, uchar *hnameIP, uchar *msg, int f
if((pMsg->msgFlags & PARSE_HOSTNAME) == 0)
MsgSetHOSTNAME(pMsg, hname);
MsgSetRcvFrom(pMsg, hname);
+ MsgSetAfterPRIOffs(pMsg, p - msg);
CHKiRet(MsgSetRcvFromIP(pMsg, hnameIP));
- /* rgerhards 2004-11-19: well, well... we've now seen that we
- * have the "hostname problem" also with the traditional Unix
- * message. As we like to emulate it, we need to add the hostname
- * to it.
- */
- if(MsgSetUxTradMsg(pMsg, (char*)p) != 0)
- ABORT_FINALIZE(RS_RET_ERR);
-
logmsg(pMsg, flags);
finalize_it:
@@ -948,7 +941,6 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags)
CHKiRet(msgConstruct(&pMsg));
MsgSetInputName(pMsg, UCHAR_CONSTANT("rsyslogd"), sizeof("rsyslogd")-1);
- MsgSetUxTradMsg(pMsg, (char*)msg);
MsgSetRawMsg(pMsg, (char*)msg);
MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName());
MsgSetRcvFrom(pMsg, glbl.GetLocalHostName());
@@ -1370,8 +1362,8 @@ int parseRFCSyslogMsg(msg_t *pMsg, int flags)
BEGINfunc
assert(pMsg != NULL);
- assert(pMsg->pszUxTradMsg != NULL);
- p2parse = pMsg->pszUxTradMsg;
+ assert(pMsg->pszRawMsg != NULL);
+ p2parse = pMsg->pszRawMsg + pMsg->offAfterPRI; /* point to start of text, after PRI */
/* do a sanity check on the version and eat it */
assert(p2parse[0] == '1' && p2parse[1] == ' ');
@@ -1471,8 +1463,8 @@ int parseLegacySyslogMsg(msg_t *pMsg, int flags)
BEGINfunc
assert(pMsg != NULL);
- assert(pMsg->pszUxTradMsg != NULL);
- p2parse = pMsg->pszUxTradMsg;
+ assert(pMsg->pszRawMsg != NULL);
+ p2parse = pMsg->pszRawMsg + pMsg->offAfterPRI; /* point to start of text, after PRI */
/* Check to see if msg contains a timestamp. We start by assuming
* that the message timestamp is the time of reciption (which we
@@ -1685,8 +1677,9 @@ logmsg(msg_t *pMsg, int flags)
BEGINfunc
assert(pMsg != NULL);
- assert(pMsg->pszUxTradMsg != NULL);
- msg = (char*) pMsg->pszUxTradMsg;
+ assert(pMsg->pszRawMsg != NULL);
+
+ msg = (char*) pMsg->pszRawMsg + pMsg->offAfterPRI; /* point to start of text, after PRI */
DBGPRINTF("logmsg: flags %x, from '%s', msg %s\n", flags, getRcvFrom(pMsg), msg);
/* rger 2005-11-24 (happy thanksgiving!): we now need to check if we have