summaryrefslogtreecommitdiffstats
path: root/tools/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-01 14:33:19 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-01 14:33:19 +0200
commit7bfa03bdc0b73647ffdbe4b73e5c1649af665fbf (patch)
tree545a24dd681bd28455702b06dff41f7814bf3561 /tools/syslogd.c
parentd6faee67b413d1f257c96a14e46f15ec1868a365 (diff)
downloadrsyslog-7bfa03bdc0b73647ffdbe4b73e5c1649af665fbf.tar.gz
rsyslog-7bfa03bdc0b73647ffdbe4b73e5c1649af665fbf.tar.xz
rsyslog-7bfa03bdc0b73647ffdbe4b73e5c1649af665fbf.zip
now put the new property-based methods to good use
... hopefully reducing the number of allocs/frees as well as overall memory usage in a busy system (plus that these shared properties hopefully remain in cache longer than its single-instance counterparts...)
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r--tools/syslogd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index be5b5aad..f7253a8e 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -559,6 +559,8 @@ static inline rsRetVal printline(uchar *hname, uchar *hnameIP, uchar *msg, int f
register uchar *p;
int pri;
msg_t *pMsg;
+ prop_t *propFromHost = NULL;
+ prop_t *propFromHostIP = NULL;
/* Now it is time to create the message object (rgerhards) */
if(stTime == NULL) {
@@ -597,9 +599,9 @@ static inline rsRetVal printline(uchar *hname, uchar *hnameIP, uchar *msg, int f
*/
if((pMsg->msgFlags & PARSE_HOSTNAME) == 0)
MsgSetHOSTNAME(pMsg, hname, ustrlen(hname));
- MsgSetRcvFromStr(pMsg, hname, ustrlen(hname));
+ MsgSetRcvFromStr(pMsg, hname, ustrlen(hname), &propFromHost);
+ CHKiRet(MsgSetRcvFromIPStr(pMsg, hnameIP, ustrlen(hname), &propFromHostIP));
MsgSetAfterPRIOffs(pMsg, p - msg);
- CHKiRet(MsgSetRcvFromIPStr(pMsg, hnameIP, ustrlen(hname)));
logmsg(pMsg, flags);