diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-11 18:19:16 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-11 18:19:16 +0200 |
commit | 4066d4cb4fa571163189023ee6c856f1c090e1f0 (patch) | |
tree | 0a438bed9b469554686b9f0200643cf691a48c1e /plugins/imptcp/imptcp.c | |
parent | da5caafa90336d4b193a4174e06c19939502b0d0 (diff) | |
parent | 0eb0562fe69b9e109263a38934037a310fc4db62 (diff) | |
download | rsyslog-4066d4cb4fa571163189023ee6c856f1c090e1f0.tar.gz rsyslog-4066d4cb4fa571163189023ee6c856f1c090e1f0.tar.bz2 rsyslog-4066d4cb4fa571163189023ee6c856f1c090e1f0.zip |
Merge branch 'c9'
Conflicts:
plugins/imptcp/imptcp.c
Diffstat (limited to 'plugins/imptcp/imptcp.c')
-rw-r--r-- | plugins/imptcp/imptcp.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c index dd027770..55e6f947 100644 --- a/plugins/imptcp/imptcp.c +++ b/plugins/imptcp/imptcp.c @@ -130,6 +130,7 @@ struct instanceConf_s { uchar *pszBindRuleset; /* name of ruleset to bind to */ uchar *pszInputName; /* value for inputname property, NULL is OK and handled by core engine */ ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */ + uchar *dfltTZ; int ratelimitInterval; int ratelimitBurst; struct instanceConf_s *next; @@ -162,6 +163,7 @@ static struct cnfparamdescr inppdescr[] = { { "address", eCmdHdlrString, 0 }, { "name", eCmdHdlrString, 0 }, { "ruleset", eCmdHdlrString, 0 }, + { "defaulttz", eCmdHdlrString, 0 }, { "supportoctetcountedframing", eCmdHdlrBinary, 0 }, { "notifyonconnectionclose", eCmdHdlrBinary, 0 }, { "compression.mode", eCmdHdlrGetWord, 0 }, @@ -202,6 +204,7 @@ struct ptcpsrv_s { int iKeepAliveTime; uint8_t compressionMode; uchar *pszInputName; + uchar *dfltTZ; prop_t *pInputName; /* InputName in (fast to process) property format */ ruleset_t *pRuleset; ptcplstn_t *pLstn; /* root of our listeners */ @@ -694,6 +697,8 @@ doSubmitMsg(ptcpsess_t *pThis, struct syslogTime *stTime, time_t ttGenTime, mult MsgSetRawMsg(pMsg, (char*)pThis->pMsg, pThis->iMsg); MsgSetInputName(pMsg, pSrv->pInputName); MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY); + if(pSrv->dfltTZ != NULL) + MsgSetDfltTZ(pMsg, (char*) pSrv->dfltTZ); pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME; MsgSetRcvFrom(pMsg, pThis->peerName); CHKiRet(MsgSetRcvFromIP(pMsg, pThis->peerIP)); @@ -1174,6 +1179,7 @@ createInstance(instanceConf_t **pinst) inst->iKeepAliveProbes = 0; inst->iKeepAliveTime = 0; inst->bEmitMsgOnClose = 0; + inst->dfltTZ = NULL; inst->iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; inst->pBindRuleset = NULL; inst->ratelimitBurst = 10000; /* arbitrary high limit */ @@ -1259,6 +1265,7 @@ addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) pSrv->iKeepAliveTime = inst->iKeepAliveTime; pSrv->bEmitMsgOnClose = inst->bEmitMsgOnClose; pSrv->compressionMode = inst->compressionMode; + pSrv->dfltTZ = inst->dfltTZ; CHKiRet(ratelimitNew(&pSrv->ratelimiter, "imtcp", (char*)inst->pszBindPort)); ratelimitSetLinuxLike(pSrv->ratelimiter, inst->ratelimitInterval, inst->ratelimitBurst); ratelimitSetThreadSafe(pSrv->ratelimiter); @@ -1607,6 +1614,8 @@ CODESTARTnewInpInst inst->iAddtlFrameDelim = (int) pvals[i].val.d.n; } else if(!strcmp(inppblk.descr[i].name, "notifyonconnectionclose")) { inst->bEmitMsgOnClose = (int) pvals[i].val.d.n; + } else if(!strcmp(inppblk.descr[i].name, "defaulttz")) { + inst->dfltTZ = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); } else if(!strcmp(inppblk.descr[i].name, "ratelimit.burst")) { inst->ratelimitBurst = (int) pvals[i].val.d.n; } else if(!strcmp(inppblk.descr[i].name, "ratelimit.interval")) { @@ -1761,6 +1770,7 @@ CODESTARTfreeCnf free(inst->pszBindAddr); free(inst->pszBindRuleset); free(inst->pszInputName); + free(inst->dfltTZ); del = inst; inst = inst->next; free(del); |