diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-04-08 14:20:34 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-04-08 14:20:34 +0200 |
commit | ba592431e279b3dafb74b93824a1478ff0d9724f (patch) | |
tree | 87d135a09528c61a478cc8269bdb52bbf46e66b2 /plugins/omrelp/omrelp.c | |
parent | 610137b49d5e4f8a0d448d8d361c042cf451a550 (diff) | |
download | rsyslog-ba592431e279b3dafb74b93824a1478ff0d9724f.tar.gz rsyslog-ba592431e279b3dafb74b93824a1478ff0d9724f.tar.bz2 rsyslog-ba592431e279b3dafb74b93824a1478ff0d9724f.zip |
omrelp: add ability to specify session timeout
Diffstat (limited to 'plugins/omrelp/omrelp.c')
-rw-r--r-- | plugins/omrelp/omrelp.c | 11 |
1 files changed, 9 insertions, 2 deletions
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); |