summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-18 14:30:21 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-18 14:30:21 +0200
commit2f86678c577ee469852ffae35123c4a90b12d214 (patch)
treee1ff06f634189b2248bae72347cde25d4f5f242d /plugins
parent8628312396b1535c41124e499d292f4d1e77d955 (diff)
downloadrsyslog-2f86678c577ee469852ffae35123c4a90b12d214.tar.gz
rsyslog-2f86678c577ee469852ffae35123c4a90b12d214.tar.xz
rsyslog-2f86678c577ee469852ffae35123c4a90b12d214.zip
optimized TAG handling in msg object
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imfile/imfile.c4
-rw-r--r--plugins/imklog/imklog.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index bdd222c4..0dabc757 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -61,6 +61,7 @@ DEFobjCurrIf(strm)
typedef struct fileInfo_s {
uchar *pszFileName;
uchar *pszTag;
+ size_t lenTag;
uchar *pszStateFile; /* file in which state between runs is to be stored */
int iFacility;
int iSeverity;
@@ -100,7 +101,7 @@ static rsRetVal enqLine(fileInfo_t *pInfo, cstr_t *cstrLine)
MsgSetRawMsg(pMsg, (char*)rsCStrGetSzStr(cstrLine), cstrLen(cstrLine));
MsgSetMSG(pMsg, (char*)rsCStrGetSzStr(cstrLine));
MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName());
- MsgSetTAG(pMsg, (char*)pInfo->pszTag);
+ MsgSetTAG(pMsg, pInfo->pszTag, pInfo->lenTag);
pMsg->iFacility = LOG_FAC(pInfo->iFacility);
pMsg->iSeverity = LOG_PRI(pInfo->iSeverity);
pMsg->bParseHOSTNAME = 0;
@@ -471,6 +472,7 @@ static rsRetVal addMonitor(void __attribute__((unused)) *pVal, uchar *pNewVal)
ABORT_FINALIZE(RS_RET_CONFIG_ERROR);
} else {
pThis->pszTag = (uchar*) strdup((char*) pszFileTag);
+ pThis->lenTag = ustrlen(pThis->pszTag);
}
if(pszStateFile == NULL) {
diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c
index 24f15510..bf60ebe5 100644
--- a/plugins/imklog/imklog.c
+++ b/plugins/imklog/imklog.c
@@ -101,7 +101,7 @@ enqMsg(uchar *msg, uchar* pszTag, int iFacility, int iSeverity)
MsgSetRcvFrom(pMsg, glbl.GetLocalHostName());
MsgSetRcvFromIP(pMsg, (uchar*)"127.0.0.1");
MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName());
- MsgSetTAG(pMsg, (char*)pszTag);
+ MsgSetTAG(pMsg, pszTag, ustrlen(pszTag));
pMsg->iFacility = LOG_FAC(iFacility);
pMsg->iSeverity = LOG_PRI(iSeverity);
pMsg->bParseHOSTNAME = 0;