diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-18 09:05:00 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-18 09:05:00 +0200 |
commit | 2697dc1a90e0fa3ad1b89f903095f22a54659b8a (patch) | |
tree | e06c7aa83f9a8a2fe64350183bcf047fb508f079 /plugins/imrelp/imrelp.c | |
parent | a744cf849f91dd699a87cccc6b9566aba4dc39f8 (diff) | |
download | rsyslog-2697dc1a90e0fa3ad1b89f903095f22a54659b8a.tar.gz rsyslog-2697dc1a90e0fa3ad1b89f903095f22a54659b8a.tar.bz2 rsyslog-2697dc1a90e0fa3ad1b89f903095f22a54659b8a.zip |
imrelp: switch to newer-style librelp interface
This interface permits us to pass a user-pointer to librelp, which
it will pass back to us on message reception. This is the foundation
for some more advanced features that require access to imrelp's
configration object.
Diffstat (limited to 'plugins/imrelp/imrelp.c')
-rw-r--r-- | plugins/imrelp/imrelp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index 06abde26..cf797447 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -137,10 +137,11 @@ static struct cnfparamblk inppblk = * we will only see the hostname (twice). -- rgerhards, 2009-10-14 */ static relpRetVal -onSyslogRcv(uchar *pHostname, uchar *pIP, uchar *msg, size_t lenMsg) +onSyslogRcv(void *pUsr, uchar *pHostname, uchar *pIP, uchar *msg, size_t lenMsg) { prop_t *pProp = NULL; msg_t *pMsg; + instanceConf_t *inst = (instanceConf_t*) pUsr; DEFiRet; CHKiRet(msgConstruct(&pMsg)); @@ -239,7 +240,7 @@ addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) CHKiRet(relpEngineSetDbgprint(pRelpEngine, dbgprintf)); CHKiRet(relpEngineSetFamily(pRelpEngine, glbl.GetDefPFFamily())); CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required)); - CHKiRet(relpEngineSetSyslogRcv(pRelpEngine, onSyslogRcv)); + CHKiRet(relpEngineSetSyslogRcv2(pRelpEngine, onSyslogRcv)); if (!glbl.GetDisableDNS()) { CHKiRet(relpEngineSetDnsLookupMode(pRelpEngine, 1)); } @@ -255,6 +256,7 @@ addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) if(inst->dhBits) { relpSrvSetDHBits(pSrv, inst->dhBits); } + relpSrvSetUsrPtr(pSrv, inst); relpSrvSetGnuTLSPriString(pSrv, (char*)inst->pristring); if(relpSrvSetCACert(pSrv, (char*) inst->caCertFile) != RELP_RET_OK) ABORT_FINALIZE(RS_RET_RELP_ERR); |