summaryrefslogtreecommitdiffstats
path: root/obj.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-11 14:12:25 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-11 14:12:25 +0000
commit8dad3997505f71e6e9962892f79d7b7dad0a89ce (patch)
treece49da850c9d4deaf6143ef2232766e8c1ccdd35 /obj.c
parente095d1ab45b205b4849151b15592c2824f04373a (diff)
downloadrsyslog-8dad3997505f71e6e9962892f79d7b7dad0a89ce.tar.gz
rsyslog-8dad3997505f71e6e9962892f79d7b7dad0a89ce.tar.xz
rsyslog-8dad3997505f71e6e9962892f79d7b7dad0a89ce.zip
file stream objects are now persistet on immediate queue shutdown (queue
itself is not yet fully persisted)
Diffstat (limited to 'obj.c')
-rw-r--r--obj.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/obj.c b/obj.c
index 938e1ead..97fb3373 100644
--- a/obj.c
+++ b/obj.c
@@ -125,7 +125,7 @@ static rsRetVal objSerializeHeader(strm_t *pStrm, obj_t *pObj)
DEFiRet;
assert(pStrm != NULL);
- assert(pObj != NULL);
+ ISOBJ_assert(pObj);
/* object cookie and serializer version (so far always 1) */
CHKiRet(strmWriteChar(pStrm, COOKIE_OBJLINE));
@@ -186,6 +186,7 @@ rsRetVal objSerializeProp(strm_t *pStrm, uchar *pszPropName, propertyType_t prop
assert(pStrm != NULL);
assert(pszPropName != NULL);
+ dbgprintf("objSerializeProp: strm %p, propName '%s', type %d, pUsr %p\n", pStrm, pszPropName, propType, pUsr);
/* if we have no user pointer, there is no need to write this property.
* TODO: think if that's the righ point of view
* rgerhards, 2008-01-06
@@ -194,6 +195,8 @@ rsRetVal objSerializeProp(strm_t *pStrm, uchar *pszPropName, propertyType_t prop
ABORT_FINALIZE(RS_RET_OK);
}
+ /* TODO: use the stream functions for data conversion here - should be quicker */
+
switch(propType) {
case PROPTYPE_PSZ:
pszBuf = (uchar*) pUsr;
@@ -413,7 +416,6 @@ static rsRetVal objDeserializeHeader(objID_t *poID, int* poVers, strm_t *pStrm)
*poVers = oVers;
finalize_it:
-dbgprintf("DeserializeHeader oid: %ld, vers: %ld, iRet: %d\n", ioID, oVers, iRet);
return iRet;
}
@@ -632,7 +634,7 @@ rsRetVal objRegisterObj(objID_t oID, objInfo_t *pInfo)
assert(pInfo != NULL);
if(oID < 1 || oID > OBJ_NUM_IDS)
ABORT_FINALIZE(RS_RET_INVALID_OID);
-
+
arrObjInfo[oID] = pInfo;
finalize_it: