summaryrefslogtreecommitdiffstats
path: root/plugins/omrelp/omrelp.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-21 15:02:41 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-21 15:02:41 +0000
commit3e4da6f1cc1e462c3a2f58b0587cef4e0028b137 (patch)
tree1ca808f09d03fce33dbbf9e3d01c42266ab7d95c /plugins/omrelp/omrelp.c
parent05c6fdb27f98e4d8ad8f94d4de1ff0e8a543e5a2 (diff)
downloadrsyslog-3e4da6f1cc1e462c3a2f58b0587cef4e0028b137.tar.gz
rsyslog-3e4da6f1cc1e462c3a2f58b0587cef4e0028b137.tar.xz
rsyslog-3e4da6f1cc1e462c3a2f58b0587cef4e0028b137.zip
added capability to receive RELP messages and forward them to the main
message queue to imrelp (not yet fully finished)
Diffstat (limited to 'plugins/omrelp/omrelp.c')
-rw-r--r--plugins/omrelp/omrelp.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c
index 767b3f85..ed3a73c2 100644
--- a/plugins/omrelp/omrelp.c
+++ b/plugins/omrelp/omrelp.c
@@ -158,33 +158,12 @@ static rsRetVal TCPSendPrepRetry(void *pvData)
}
-/* open a connection to the remote peer (transport level)
- * rgerhards, 2007-12-28
- */
-static rsRetVal openConn(void *pvData)
-{
- DEFiRet;
- instanceData *pData = (instanceData *) pvData;
-
- assert(pData != NULL);
- if(pData->sock < 0) {
- if((pData->sock = tcpclt.CreateSocket(pData->f_addr)) < 0)
- iRet = RS_RET_TCP_SOCKCREATE_ERR;
- }
-
- RETiRet;
-}
-
-
/* try to resume connection if it is not ready
* rgerhards, 2007-08-02
*/
static rsRetVal doTryResume(instanceData *pData)
{
DEFiRet;
- struct addrinfo *res;
- struct addrinfo hints;
- unsigned e;
switch (pData->eDestState) {
case eDestFORW_SUSP:
@@ -195,8 +174,8 @@ static rsRetVal doTryResume(instanceData *pData)
case eDestFORW_UNKN:
/* The remote address is not yet known and needs to be obtained */
dbgprintf(" %s\n", pData->f_hname);
- iRet = relpCltConnect(pData->pRelpClt, family, pData->port, pData->f_hname);
- if(iRet = RELP_RET_OK)
+ iRet = relpCltConnect(pData->pRelpClt, family, (uchar*) pData->port, (uchar*) pData->f_hname);
+ if(iRet == RELP_RET_OK)
pData->eDestState = eDestFORW;
break;
case eDestFORW:
@@ -244,7 +223,7 @@ RUNLOG_VAR("%d", pData->eDestState);
/* forward */
relpRetVal ret;
RUNLOG;
- ret = relpCltSendSyslog(pData->pRelpClt, psz, l);
+ ret = relpCltSendSyslog(pData->pRelpClt, (uchar*) psz, l);
RUNLOG_VAR("%d", ret);
if(ret != RS_RET_OK) {
/* error! */
@@ -260,9 +239,7 @@ ENDdoAction
BEGINparseSelectorAct
uchar *q;
int i;
- int error;
int bErr;
- struct addrinfo hints, *res;
TCPFRAMINGMODE tcp_framing;
CODESTARTparseSelectorAct
CODE_STD_STRING_REQUESTparseSelectorAct(1)