diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-06 17:59:40 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-06 17:59:40 +0000 |
commit | 2c81480d28e7380939d43da2e8592dc257379822 (patch) | |
tree | 67291dc3e9097830859450045033470943fd6e3e /msg.c | |
parent | 22ea87ec597245df9216aa6a6b9da2a379ca1a40 (diff) | |
download | rsyslog-2c81480d28e7380939d43da2e8592dc257379822.tar.gz rsyslog-2c81480d28e7380939d43da2e8592dc257379822.tar.xz rsyslog-2c81480d28e7380939d43da2e8592dc257379822.zip |
worked on object header (now also contains the size)
Diffstat (limited to 'msg.c')
-rw-r--r-- | msg.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -380,15 +380,12 @@ msg_t* MsgDup(msg_t* pOld) * during msg construction - and never again used later. * rgerhards, 2008-01-03 */ -static rsRetVal MsgSerialize(msg_t *pThis, uchar **ppOutBuf, size_t *pLenBuf) +static rsRetVal MsgSerialize(msg_t *pThis, rsCStrObj **ppCStr) { DEFiRet; rsCStrObj *pCStr; - assert(ppOutBuf != NULL); - assert(pLenBuf != NULL); - assert(pThis != NULL); - + assert(ppCStr != NULL); CHKiRet(objBeginSerialize(&pCStr, (obj_t*) pThis)); objSerializeSCALAR(iProtocolVersion, SHORT); @@ -411,11 +408,11 @@ static rsRetVal MsgSerialize(msg_t *pThis, uchar **ppOutBuf, size_t *pLenBuf) objSerializePTR(pCSPROCID, CSTR); objSerializePTR(pCSMSGID, CSTR); - CHKiRet(objEndSerialize(pCStr, ppOutBuf)); - pCStr = NULL; + CHKiRet(objEndSerialize((&pCStr), (obj_t*) pThis)); + *ppCStr = pCStr; finalize_it: - if(pCStr != NULL) + if(iRet != RS_RET_OK && pCStr != NULL) rsCStrDestruct(pCStr); return iRet; |