diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-03-31 17:08:01 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-03-31 17:08:01 +0200 |
commit | b30e809a202ef42e59a6c9e455e17ce56c7894bc (patch) | |
tree | 23e0584c2a0cc1fecdd7f2c9af69f7482e7c915b /runtime | |
parent | b615cbaacec3d6f25e448362095ac54fcbe6d927 (diff) | |
parent | 945bc9bd0d9de984ab11b9faf609b809a1f3cb90 (diff) | |
download | rsyslog-b30e809a202ef42e59a6c9e455e17ce56c7894bc.tar.gz rsyslog-b30e809a202ef42e59a6c9e455e17ce56c7894bc.tar.xz rsyslog-b30e809a202ef42e59a6c9e455e17ce56c7894bc.zip |
Merge branch 'v5-devel'
Conflicts:
configure.ac
doc/manual.html
doc/rsyslog_conf.html
runtime/msg.c
runtime/rsyslog.h
template.c
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/msg.c | 9 | ||||
-rw-r--r-- | runtime/parser.c | 6 | ||||
-rw-r--r-- | runtime/queue.c | 4 | ||||
-rw-r--r-- | runtime/rsyslog.h | 1 |
4 files changed, 17 insertions, 3 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index ec132489..8016068b 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -449,6 +449,8 @@ rsRetVal propNameToID(cstr_t *pCSPropName, propid_t *pPropID) *pPropID = PROP_CEE_ALL_JSON; } else if(!strncmp((char*) pName, "$!", 2)) { *pPropID = PROP_CEE; + } else if(!strcmp((char*) pName, "$bom")) { + *pPropID = PROP_SYS_BOM; } else { *pPropID = PROP_INVALID; iRet = RS_RET_VAR_NOT_FOUND; @@ -534,6 +536,8 @@ uchar *propIDToName(propid_t propID) return UCHAR_CONSTANT("*CEE-based property*"); case PROP_CEE_ALL_JSON: return UCHAR_CONSTANT("$!all-json"); + case PROP_SYS_BOM: + return UCHAR_CONSTANT("$BOM"); default: return UCHAR_CONSTANT("*invalid property id*"); } @@ -2483,6 +2487,11 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, break; case PROP_CEE: getCEEPropVal(pMsg, propName, &pRes, &bufLen, pbMustBeFreed); + case PROP_SYS_BOM: + if(*pbMustBeFreed == 1) + free(pRes); + pRes = (uchar*) "\xEF\xBB\xBF"; + *pbMustBeFreed = 0; break; default: /* there is no point in continuing, we may even otherwise render the diff --git a/runtime/parser.c b/runtime/parser.c index 8776a25e..2e991a9d 100644 --- a/runtime/parser.c +++ b/runtime/parser.c @@ -453,10 +453,10 @@ ParsePRI(msg_t *pMsg) if(pri & ~(LOG_FACMASK|LOG_PRIMASK)) pri = DEFUPRI; } + pMsg->iFacility = LOG_FAC(pri); + pMsg->iSeverity = LOG_PRI(pri); + MsgSetAfterPRIOffs(pMsg, msg - pMsg->pszRawMsg); } - pMsg->iFacility = LOG_FAC(pri); - pMsg->iSeverity = LOG_PRI(pri); - MsgSetAfterPRIOffs(pMsg, msg - pMsg->pszRawMsg); RETiRet; } diff --git a/runtime/queue.c b/runtime/queue.c index ef6e843b..50ae307c 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -1774,9 +1774,13 @@ qqueueChkStopWrkrDA(qqueue_t *pThis) { DEFiRet; +//DBGPRINTF("XXXX: chkStopWrkrDA called, low watermark %d, phys Size %d\n", pThis->iLowWtrMrk, getPhysicalQueueSize(pThis)); if(pThis->bEnqOnly) { iRet = RS_RET_TERMINATE_WHEN_IDLE; } + if(getPhysicalQueueSize(pThis) <= pThis->iLowWtrMrk) { + iRet = RS_RET_TERMINATE_NOW; + } RETiRet; } diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index 9d3d0289..23547535 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -139,6 +139,7 @@ typedef uintTiny propid_t; #define PROP_SYS_MYHOSTNAME 158 #define PROP_CEE 200 #define PROP_CEE_ALL_JSON 201 +#define PROP_SYS_BOM 159 /* The error codes below are orginally "borrowed" from |