From c40ce62e9cef031d8c33d9369c1081449970ddf6 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 8 Jan 2008 17:46:15 +0000 Subject: completed deserialization support in msg object (but not deserializer itself) --- msg.c | 24 +++++++++++++++++------- syslogd.c | 2 +- 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 -- cgit