diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | doc/omrelp.html | 4 | ||||
-rw-r--r-- | plugins/omrelp/omrelp.c | 11 |
4 files changed, 15 insertions, 3 deletions
@@ -1,4 +1,5 @@ - omrelp: added support for RainerScript-based configuration +- omrelp: added ability to specify session timeout ---------------------------------------------------------------------------- Version 7.2.7 [v7-stable] 2013-03-?? - rsyslogd startup information is now properly conveyed back to init diff --git a/configure.ac b/configure.ac index 5c1fa991..e33a3d85 100644 --- a/configure.ac +++ b/configure.ac @@ -905,7 +905,7 @@ AC_ARG_ENABLE(relp, [enable_relp=no] ) if test "x$enable_relp" = "xyes"; then - PKG_CHECK_MODULES(RELP, relp >= 1.0.1) + PKG_CHECK_MODULES(RELP, relp >= 1.0.3) fi AM_CONDITIONAL(ENABLE_RELP, test x$enable_relp = xyes) diff --git a/doc/omrelp.html b/doc/omrelp.html index 4b28bdda..8858f884 100644 --- a/doc/omrelp.html +++ b/doc/omrelp.html @@ -30,6 +30,10 @@ must be used. <li><b>template </b>(not mandatory, default "RSYSLOG_ForwardFormat")<br> Defines the template to be used for the output. </li> + <li><b>timeout </b>(not mandatory, default 90)<br> + Timeout for relp sessions. If set too low, valid sessions + may be considered dead and tried to recover. + </li> </ul> <p><b>Sample:</b></p> <p>The following sample sends all messages to the central server diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c index 0c296673..7d536cbc 100644 --- a/plugins/omrelp/omrelp.c +++ b/plugins/omrelp/omrelp.c @@ -63,7 +63,8 @@ typedef struct _instanceData { uchar *port; int bInitialConnect; /* is this the initial connection request of our module? (0-no, 1-yes) */ int bIsConnected; /* currently connected to server? 0 - no, 1 - yes */ - relpClt_t *pRelpClt; /* relp client for this instance */ + unsigned timeout; + relpClt_t *pRelpClt; /* relp client for this instance */ uchar *tplName; } instanceData; @@ -76,8 +77,9 @@ static configSettings_t __attribute__((unused)) cs; /* tables for interfacing with the v6 config system */ /* action (instance) parameters */ static struct cnfparamdescr actpdescr[] = { - { "target", eCmdHdlrGetWord, 0 }, + { "target", eCmdHdlrGetWord, 1 }, { "port", eCmdHdlrGetWord, 0 }, + { "timeout", eCmdHdlrInt, 0 }, { "template", eCmdHdlrGetWord, 1 } }; static struct cnfparamblk actpblk = @@ -109,6 +111,8 @@ doCreateRelpClient(instanceData *pData) DEFiRet; if(relpEngineCltConstruct(pRelpEngine, &pData->pRelpClt) != RELP_RET_OK) ABORT_FINALIZE(RS_RET_RELP_ERR); + if(relpCltSetTimeout(pData->pRelpClt, pData->timeout) != RELP_RET_OK) + ABORT_FINALIZE(RS_RET_RELP_ERR); finalize_it: RETiRet; } @@ -134,6 +138,7 @@ setInstParamDefaults(instanceData *pData) pData->target = NULL; pData->port = NULL; pData->tplName = NULL; + pData->timeout = 90; } @@ -157,6 +162,8 @@ CODESTARTnewActInst pData->port = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); } else if(!strcmp(actpblk.descr[i].name, "template")) { pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); + } else if(!strcmp(actpblk.descr[i].name, "timeout")) { + pData->timeout = (unsigned) pvals[i].val.d.n; } else { dbgprintf("omrelp: program error, non-handled " "param '%s'\n", actpblk.descr[i].name); |