diff options
author | Martin Körper <martin.koerper@a-cert.at> | 2013-01-08 11:51:53 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-01-08 11:51:53 +0100 |
commit | 9fb9fa03a2cfeab700f8c3c893f08d1a60d3f75e (patch) | |
tree | 160e542fc81478b3b1d0fd5a418692d80d3b15af | |
parent | 9955c1f5795b2397e3cf75c5bf89f5e1e28ba001 (diff) | |
download | rsyslog-9fb9fa03a2cfeab700f8c3c893f08d1a60d3f75e.tar.gz rsyslog-9fb9fa03a2cfeab700f8c3c893f08d1a60d3f75e.tar.bz2 rsyslog-9fb9fa03a2cfeab700f8c3c893f08d1a60d3f75e.zip |
bugfix: compile errors in im3195
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | plugins/im3195/im3195.c | 15 |
2 files changed, 16 insertions, 1 deletions
@@ -18,6 +18,8 @@ Version 7.2.5 [v7-stable] 2013-01-?? closes: http://bugzilla.adiscon.com/show_bug.cgi?id=394 Thanks to David Hill for the patch [under ASL2.0 as per email conversation 2013-01-03]. +- bugfix: compile errors in im3195 + Thanks to Martin Körper for the patch ---------------------------------------------------------------------------- Version 7.2.4 [v7-stable] 2012-12-07 - enhance: permit RFC3339 timestamp in local log socket messages diff --git a/plugins/im3195/im3195.c b/plugins/im3195/im3195.c index c75e0e34..4b04b124 100644 --- a/plugins/im3195/im3195.c +++ b/plugins/im3195/im3195.c @@ -48,6 +48,7 @@ #include "cfsysline.h" #include "msg.h" #include "errmsg.h" +#include "unicode-helper.h" MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP @@ -56,6 +57,7 @@ MODULE_CNFNAME("im3195") /* Module static data */ DEF_IMOD_STATIC_DATA DEFobjCurrIf(errmsg) +DEFobjCurrIf(prop) /* configuration settings */ @@ -71,6 +73,8 @@ static int listenPort = 601; */ static srAPIObj* pAPI; +static prop_t *pInputName = NULL; /* there is only one global inputName for all messages generated by this module */ + /* This method is called when a message has been fully received. * It passes the received message to the rsyslog main message @@ -90,7 +94,7 @@ void OnReceive(srAPIObj __attribute__((unused)) *pMyAPI, srSLMGObj* pSLMG) srSLMGGetRawMSG(pSLMG, &pszRawMsg); parseAndSubmitMessage(fromHost, fromHostIP, pszRawMsg, strlen((char*)pszRawMsg), - PARSE_HOSTNAME, eFLOWCTL_FULL_DELAY, (uchar*)"im3195", NULL, 0, NULL); + PARSE_HOSTNAME, eFLOWCTL_FULL_DELAY, pInputName, NULL, 0, NULL); } @@ -171,6 +175,9 @@ ENDafterRun BEGINmodExit CODESTARTmodExit srAPIExitLib(pAPI); /* terminate liblogging */ + /* global variable cleanup */ + if(pInputName != NULL) + prop.Destruct(&pInputName); /* release objects we used */ objRelease(errmsg, CORE_COMPONENT); ENDmodExit @@ -193,9 +200,15 @@ CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(errmsg, CORE_COMPONENT)); + CHKiRet(objUse(prop, CORE_COMPONENT)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"input3195listenport", 0, eCmdHdlrInt, NULL, &listenPort, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); + + CHKiRet(prop.Construct(&pInputName)); + CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("im3195"), sizeof("im3195") - 1)); + CHKiRet(prop.ConstructFinalize(pInputName)); + ENDmodInit /* vim:set ai: */ |