summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-08 17:46:15 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-08 17:46:15 +0000
commitc40ce62e9cef031d8c33d9369c1081449970ddf6 (patch)
tree6d6b8bb15e576080c2dc7c13ca0d9901426a9afb
parente27555c46856475fc3686511ce8e393651de8e44 (diff)
downloadrsyslog-c40ce62e9cef031d8c33d9369c1081449970ddf6.tar.gz
rsyslog-c40ce62e9cef031d8c33d9369c1081449970ddf6.tar.xz
rsyslog-c40ce62e9cef031d8c33d9369c1081449970ddf6.zip
completed deserialization support in msg object (but not deserializer
itself)
-rw-r--r--msg.c24
-rw-r--r--syslogd.c2
2 files changed, 18 insertions, 8 deletions
diff --git a/msg.c b/msg.c
index ca9678b2..779224ee 100644
--- a/msg.c
+++ b/msg.c
@@ -409,7 +409,6 @@ static rsRetVal MsgSerialize(msg_t *pThis, rsCStrObj **ppCStr)
objSerializePTR(pszHOSTNAME, PSZ);
objSerializePTR(pszRcvFrom, PSZ);
- objSerializePTR(pCSProgName, CSTR);
objSerializePTR(pCSStrucData, CSTR);
objSerializePTR(pCSAPPNAME, CSTR);
objSerializePTR(pCSPROCID, CSTR);
@@ -914,18 +913,15 @@ rsRetVal MsgSetAPPNAME(msg_t *pMsg, char* pszAPPNAME)
{
DEFiRet;
assert(pMsg != NULL);
- //MsgLock(pMsg);
if(pMsg->pCSAPPNAME == NULL) {
/* we need to obtain the object first */
if((pMsg->pCSAPPNAME = rsCStrConstruct()) == NULL) {
- // MsgUnlock(pMsg);
return RS_RET_OBJ_CREATION_FAILED; /* best we can do... */
}
rsCStrSetAllocIncrement(pMsg->pCSAPPNAME, 128);
}
/* if we reach this point, we have the object */
iRet = rsCStrSetSzStr(pMsg->pCSAPPNAME, (uchar*) pszAPPNAME);
- //MsgUnlock(pMsg);
return iRet;
}
@@ -2109,12 +2105,26 @@ rsRetVal MsgSetProperty(msg_t *pThis, property_t *pProp)
MsgSetRawMsg(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
} else if(isProp("pszMSG")) {
MsgSetMSG(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
+ } else if(isProp("pszUxTradMsg")) {
+ MsgSetUxTradMsg(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
} else if(isProp("pszTAG")) {
MsgSetTAG(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
- } else if(isProp("pszHOSTNAME")) {
+ } else if(isProp("pszRcvFrom")) {
MsgSetHOSTNAME(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
- } else if(isProp("pszUxTradMsg")) {
- MsgSetUxTradMsg(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
+ } else if(isProp("pszHOSTNAME")) {
+ MsgSetRcvFrom(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
+ } else if(isProp("pCSStrucData")) {
+ MsgSetStructuredData(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
+ } else if(isProp("pCSAPPNAME")) {
+ MsgSetAPPNAME(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
+ } else if(isProp("pCSPROCID")) {
+ MsgSetPROCID(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
+ } else if(isProp("pCSMSGID")) {
+ MsgSetMSGID(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.vpCStr));
+ } else if(isProp("tRcvdAt")) {
+ memcpy(&pThis->tRcvdAt, &pProp->val.vSyslogTime, sizeof(struct syslogTime));
+ } else if(isProp("tTIMESTAMP")) {
+ memcpy(&pThis->tTIMESTAMP, &pProp->val.vSyslogTime, sizeof(struct syslogTime));
}
return iRet;
diff --git a/syslogd.c b/syslogd.c
index 64d8ede8..79a0caa0 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2614,7 +2614,7 @@ die(int sig)
dbgprintf("Terminating outputs...\n");
freeSelectors();
- dbgprintf("all primary multi-thread sources have been terminated - now doing aux cleanp\n");
+ dbgprintf("all primary multi-thread sources have been terminated - now doing aux cleanup...\n");
/* rger 2005-02-22
* now clean up the in-memory structures. OK, the OS
* would also take care of that, but if we do it