summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-23 17:48:13 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-23 17:48:13 +0200
commit721b9ee252143d182c3c145380e5dbec8c3b0102 (patch)
tree74878afb2db80eb489a4dbd47c0a84d3ffff7b56 /plugins
parent50fe2ec2ea275b7ed38c7942736fbb2aae727056 (diff)
downloadrsyslog-721b9ee252143d182c3c145380e5dbec8c3b0102.tar.gz
rsyslog-721b9ee252143d182c3c145380e5dbec8c3b0102.tar.xz
rsyslog-721b9ee252143d182c3c145380e5dbec8c3b0102.zip
client functionality works again (with the new socket abstraction)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imtcp/imtcp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c
index 17a48d17..1e599d14 100644
--- a/plugins/imtcp/imtcp.c
+++ b/plugins/imtcp/imtcp.c
@@ -43,6 +43,7 @@
#include "cfsysline.h"
#include "module-template.h"
#include "net.h"
+#include "netstrm.h"
#include "tcpsrv.h"
MODULE_TYPE_INPUT
@@ -52,6 +53,7 @@ DEF_IMOD_STATIC_DATA
DEFobjCurrIf(tcpsrv)
DEFobjCurrIf(tcps_sess)
DEFobjCurrIf(net)
+DEFobjCurrIf(netstrm)
/* Module static data */
static tcpsrv_t *pOurTcpsrv = NULL; /* our TCP server(listener) TODO: change for multiple instances */
@@ -81,10 +83,12 @@ doOpenLstnSocks(tcpsrv_t *pSrv)
static int
doRcvData(tcps_sess_t *pSess, char *buf, size_t lenBuf)
{
- int state;
+ ssize_t state;
assert(pSess != NULL);
- state = recv(pSess->sock, buf, lenBuf, 0);
+ state = lenBuf;
+ if(netstrm.Rcv(pSess->pStrm, (uchar*) buf, &state) != RS_RET_OK)
+ state = -1; // TODO: move this function to an iRet interface! 2008-04-23
return state;
}
@@ -172,6 +176,7 @@ CODESTARTmodExit
/* release objects we used */
objRelease(net, LM_NET_FILENAME);
+ objRelease(netstrm, LM_NETSTRM_FILENAME);
objRelease(tcps_sess, LM_TCPSRV_FILENAME);
objRelease(tcpsrv, LM_TCPSRV_FILENAME);
ENDmodExit
@@ -199,6 +204,7 @@ CODEmodInit_QueryRegCFSLineHdlr
pOurTcpsrv = NULL;
/* request objects we use */
CHKiRet(objUse(net, LM_NET_FILENAME));
+ CHKiRet(objUse(netstrm, LM_NETSTRM_FILENAME));
CHKiRet(objUse(tcps_sess, LM_TCPSRV_FILENAME));
CHKiRet(objUse(tcpsrv, LM_TCPSRV_FILENAME));