summaryrefslogtreecommitdiffstats
path: root/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-06 17:59:40 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-06 17:59:40 +0000
commit2c81480d28e7380939d43da2e8592dc257379822 (patch)
tree67291dc3e9097830859450045033470943fd6e3e /msg.c
parent22ea87ec597245df9216aa6a6b9da2a379ca1a40 (diff)
downloadrsyslog-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.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/msg.c b/msg.c
index f7943307..a224b308 100644
--- a/msg.c
+++ b/msg.c
@@ -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;