summaryrefslogtreecommitdiffstats
path: root/plugins/omrelp/omrelp.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-07-02 14:51:06 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-07-02 14:51:06 +0200
commit8597fdd3b9c1605ddbfd8885696e6f99afda6a3b (patch)
treeceeeaa0d4089d38be6c2845d12ff2014d0e81f42 /plugins/omrelp/omrelp.c
parent4acff5da8bec4a7258e61e9de0cbd6ea08d6e1aa (diff)
downloadrsyslog-8597fdd3b9c1605ddbfd8885696e6f99afda6a3b.tar.gz
rsyslog-8597fdd3b9c1605ddbfd8885696e6f99afda6a3b.tar.bz2
rsyslog-8597fdd3b9c1605ddbfd8885696e6f99afda6a3b.zip
omrelp: add "windowSize" parameter to set custom RELP window size
Diffstat (limited to 'plugins/omrelp/omrelp.c')
-rw-r--r--plugins/omrelp/omrelp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c
index d41b46a6..898bafe2 100644
--- a/plugins/omrelp/omrelp.c
+++ b/plugins/omrelp/omrelp.c
@@ -65,6 +65,7 @@ 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 */
+ int sizeWindow; /**< the RELP window size - 0=use default */
unsigned timeout;
unsigned rebindInterval;
unsigned nSent;
@@ -104,6 +105,7 @@ static struct cnfparamdescr actpdescr[] = {
{ "tls.permittedpeer", eCmdHdlrArray, 0 },
{ "port", eCmdHdlrGetWord, 0 },
{ "rebindinterval", eCmdHdlrInt, 0 },
+ { "windowsize", eCmdHdlrInt, 0 },
{ "timeout", eCmdHdlrInt, 0 },
{ "template", eCmdHdlrGetWord, 0 }
};
@@ -157,6 +159,8 @@ doCreateRelpClient(instanceData *pData)
ABORT_FINALIZE(RS_RET_RELP_ERR);
if(relpCltSetTimeout(pData->pRelpClt, pData->timeout) != RELP_RET_OK)
ABORT_FINALIZE(RS_RET_RELP_ERR);
+ if(relpCltSetWindowSize(pData->pRelpClt, pData->sizeWindow) != RELP_RET_OK)
+ ABORT_FINALIZE(RS_RET_RELP_ERR);
if(relpCltSetUsrPtr(pData->pRelpClt, pData) != RELP_RET_OK)
ABORT_FINALIZE(RS_RET_RELP_ERR);
if(pData->bEnableTLS) {
@@ -195,6 +199,7 @@ finalize_it:
BEGINcreateInstance
CODESTARTcreateInstance
+ pData->sizeWindow = 0;
pData->timeout = 90;
pData->rebindInterval = 0;
pData->bEnableTLS = DFLT_ENABLE_TLS;
@@ -233,6 +238,7 @@ setInstParamDefaults(instanceData *pData)
pData->port = NULL;
pData->tplName = NULL;
pData->timeout = 90;
+ pData->sizeWindow = 0;
pData->rebindInterval = 0;
pData->bEnableTLS = DFLT_ENABLE_TLS;
pData->bEnableTLSZip = DFLT_ENABLE_TLSZIP;
@@ -269,6 +275,8 @@ CODESTARTnewActInst
pData->timeout = (unsigned) pvals[i].val.d.n;
} else if(!strcmp(actpblk.descr[i].name, "rebindinterval")) {
pData->rebindInterval = (unsigned) pvals[i].val.d.n;
+ } else if(!strcmp(actpblk.descr[i].name, "windowsize")) {
+ pData->sizeWindow = (int) pvals[i].val.d.n;
} else if(!strcmp(actpblk.descr[i].name, "tls")) {
pData->bEnableTLS = (unsigned) pvals[i].val.d.n;
} else if(!strcmp(actpblk.descr[i].name, "tls.compression")) {