diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-29 12:08:43 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-29 12:08:43 +0100 |
commit | 9f74e3521fdfe0d2c68038b07ff64508a3d7d145 (patch) | |
tree | 7c8af8f36e3d20e105ab6dd3613c7eb9d8251535 | |
parent | c18c7a0dc6b38269ee97fa66ce6327693194cb5d (diff) | |
download | rsyslog-9f74e3521fdfe0d2c68038b07ff64508a3d7d145.tar.gz rsyslog-9f74e3521fdfe0d2c68038b07ff64508a3d7d145.tar.bz2 rsyslog-9f74e3521fdfe0d2c68038b07ff64508a3d7d145.zip |
remove legacy API parseAndSubmitMessage() from imrelp
-rw-r--r-- | plugins/imrelp/imrelp.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index fe987a50..31f82b14 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -113,11 +113,29 @@ static struct cnfparamblk inppblk = * we will only see the hostname (twice). -- rgerhards, 2009-10-14 */ static relpRetVal -onSyslogRcv(uchar *pHostname, uchar *pIP, uchar *pMsg, size_t lenMsg) +onSyslogRcv(uchar *pHostname, uchar *pIP, uchar *msg, size_t lenMsg) { + prop_t *pProp = NULL; + msg_t *pMsg; DEFiRet; - parseAndSubmitMessage(pHostname, pIP, pMsg, lenMsg, PARSE_HOSTNAME, - eFLOWCTL_LIGHT_DELAY, pInputName, NULL, 0, runModConf->pBindRuleset); + + CHKiRet(msgConstruct(&pMsg)); + MsgSetInputName(pMsg, pInputName); + MsgSetRawMsg(pMsg, (char*)msg, lenMsg); + MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY); + MsgSetRuleset(pMsg, runModConf->pBindRuleset); + pMsg->msgFlags = PARSE_HOSTNAME | NEEDS_PARSING; + + /* TODO: optimize this, we can store it inside the session, requires + * changes to librelp --> next librelp iteration?. rgerhards, 2012-10-29 + */ + MsgSetRcvFromStr(pMsg, pHostname, ustrlen(pHostname), &pProp); + CHKiRet(prop.Destruct(&pProp)); + CHKiRet(MsgSetRcvFromIPStr(pMsg, pIP, ustrlen(pIP), &pProp)); + CHKiRet(prop.Destruct(&pProp)); + CHKiRet(submitMsg2(pMsg)); + +finalize_it: RETiRet; } |