summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-08-20 12:37:39 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-08-20 12:37:39 +0200
commit4ce8111ea6c0a7cf111394edf93776a8b536d4d7 (patch)
tree962cbad40adc1cb99601c9c2e30fe51697779ee6 /runtime
parent8e408e9f532173c709c48f57c175cbd453fe8d5b (diff)
parent9fb96ec34312b6da7b496db0b3d5eb86442fed06 (diff)
downloadrsyslog-4ce8111ea6c0a7cf111394edf93776a8b536d4d7.tar.gz
rsyslog-4ce8111ea6c0a7cf111394edf93776a8b536d4d7.tar.xz
rsyslog-4ce8111ea6c0a7cf111394edf93776a8b536d4d7.zip
Merge branch 'v5-stable' into beta
Diffstat (limited to 'runtime')
-rw-r--r--runtime/obj.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/runtime/obj.c b/runtime/obj.c
index b2739c58..ffc8f608 100644
--- a/runtime/obj.c
+++ b/runtime/obj.c
@@ -610,6 +610,8 @@ static rsRetVal objDeserializeProperty(var_t *pProp, strm_t *pStrm)
number_t i;
number_t iLen;
uchar c;
+ int step = 0; /* which step was successful? */
+ int64 offs;
assert(pProp != NULL);
@@ -630,13 +632,16 @@ static rsRetVal objDeserializeProperty(var_t *pProp, strm_t *pStrm)
NEXTC;
}
CHKiRet(cstrFinalize(pProp->pcsName));
+ step = 1;
/* property type */
CHKiRet(objDeserializeNumber(&i, pStrm));
pProp->varType = i;
+ step = 2;
/* size (needed for strings) */
CHKiRet(objDeserializeNumber(&iLen, pStrm));
+ step = 3;
/* we now need to deserialize the value */
switch(pProp->varType) {
@@ -653,12 +658,44 @@ static rsRetVal objDeserializeProperty(var_t *pProp, strm_t *pStrm)
dbgprintf("invalid VARTYPE %d\n", pProp->varType);
break;
}
+ step = 4;
/* we should now be at the end of the line. So the next char must be \n */
NEXTC;
if(c != '\n') ABORT_FINALIZE(RS_RET_INVALID_PROPFRAME);
finalize_it:
+ if(Debug && iRet != RS_RET_OK) {
+ strm.GetCurrOffset(pStrm, &offs);
+ dbgprintf("error %d deserializing property name, offset %lld, step %d\n",
+ iRet, offs, step);
+ if(step >= 1) {
+ dbgprintf("error property name: '%s'\n", rsCStrGetSzStrNoNULL(pProp->pcsName));
+ }
+ if(step >= 2) {
+ dbgprintf("error var type: '%d'\n", pProp->varType);
+ }
+ if(step >= 3) {
+ dbgprintf("error len: '%d'\n", (int) iLen);
+ }
+ if(step >= 4) {
+ switch(pProp->varType) {
+ case VARTYPE_STR:
+ dbgprintf("error data string: '%s'\n",
+ rsCStrGetSzStrNoNULL(pProp->val.pStr));
+ break;
+ case VARTYPE_NUMBER:
+ dbgprintf("error number: %d\n", (int) pProp->val.num);
+ break;
+ case VARTYPE_SYSLOGTIME:
+ dbgprintf("syslog time was successfully parsed (but "
+ "is not displayed\n");
+ break;
+ default:
+ break;
+ }
+ }
+ }
RETiRet;
}