diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-08 17:46:15 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-08 17:46:15 +0000 |
commit | c40ce62e9cef031d8c33d9369c1081449970ddf6 (patch) | |
tree | 6d6b8bb15e576080c2dc7c13ca0d9901426a9afb /msg.c | |
parent | e27555c46856475fc3686511ce8e393651de8e44 (diff) | |
download | rsyslog-c40ce62e9cef031d8c33d9369c1081449970ddf6.tar.gz rsyslog-c40ce62e9cef031d8c33d9369c1081449970ddf6.tar.xz rsyslog-c40ce62e9cef031d8c33d9369c1081449970ddf6.zip |
completed deserialization support in msg object (but not deserializer
itself)
Diffstat (limited to 'msg.c')
-rw-r--r-- | msg.c | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -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; |