summaryrefslogtreecommitdiffstats
path: root/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-11 16:52:19 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-11 16:52:19 +0000
commita80f7776c543d80f773ea6149e73e008f7273186 (patch)
tree14d313bd62c5d8ff45c7466a6acb63fc0111ebed /queue.c
parent19b8d9e239f150127d8af15694f88c20ed88bd25 (diff)
downloadrsyslog-a80f7776c543d80f773ea6149e73e008f7273186.tar.gz
rsyslog-a80f7776c543d80f773ea6149e73e008f7273186.tar.xz
rsyslog-a80f7776c543d80f773ea6149e73e008f7273186.zip
support for de-serializing strm objects added
Diffstat (limited to 'queue.c')
-rw-r--r--queue.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/queue.c b/queue.c
index 116b6ab1..99919ca2 100644
--- a/queue.c
+++ b/queue.c
@@ -818,13 +818,39 @@ finalize_it:
DEFpropSetMeth(queue, bImmediateShutdown, int);
+/* This function can be used as a generic way to set properties. Only the subset
+ * of properties required to read persisted property bags is supported. This
+ * functions shall only be called by the property bag reader, thus it is static.
+ * rgerhards, 2008-01-11
+ */
+#define isProp(name) !rsCStrSzStrCmp(pProp->pcsName, (uchar*) name, sizeof(name) - 1)
+static rsRetVal queueSetProperty(queue_t *pThis, property_t *pProp)
+{
+ DEFiRet;
+
+ ISOBJ_TYPE_assert(pThis, queue);
+ assert(pProp != NULL);
+
+ if(isProp("iQueueSize")) {
+ pThis->iQueueSize = pProp->val.vInt;
+ } else if(isProp("qType")) {
+ if(pThis->qType != pProp->val.vLong)
+ ABORT_FINALIZE(RS_RET_QTYPE_MISMATCH);
+ }
+
+finalize_it:
+ return iRet;
+}
+#undef isProp
+
+
/* Initialize the stream class. Must be called as the very first method
* before anything else is called inside this class.
* rgerhards, 2008-01-09
*/
BEGINObjClassInit(queue, 1)
//OBJSetMethodHandler(objMethod_SERIALIZE, strmSerialize);
- //OBJSetMethodHandler(objMethod_SETPROPERTY, strmSetProperty);
+ OBJSetMethodHandler(objMethod_SETPROPERTY, queueSetProperty);
//OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, strmConstructFinalize);
ENDObjClassInit(strm)