summaryrefslogtreecommitdiffstats
path: root/plugins/imtcp/imtcp.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-30 14:51:45 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-30 14:51:45 +0200
commitb0d63ea8f26f525bbfd177aaa6a1294b0d94f1f9 (patch)
tree8ff1fa91347b213919636eb458ec8c5989e7ac3e /plugins/imtcp/imtcp.c
parent055d4ffc2afc77e03a3d31720d4a0998f8c3d92c (diff)
downloadrsyslog-b0d63ea8f26f525bbfd177aaa6a1294b0d94f1f9.tar.gz
rsyslog-b0d63ea8f26f525bbfd177aaa6a1294b0d94f1f9.tar.xz
rsyslog-b0d63ea8f26f525bbfd177aaa6a1294b0d94f1f9.zip
made plain tcp syslog via TLS work on the server
... but so far only in blocking mode
Diffstat (limited to 'plugins/imtcp/imtcp.c')
-rw-r--r--plugins/imtcp/imtcp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c
index bb5f4fe5..a9924365 100644
--- a/plugins/imtcp/imtcp.c
+++ b/plugins/imtcp/imtcp.c
@@ -44,6 +44,7 @@
#include "module-template.h"
#include "net.h"
#include "netstrm.h"
+#include "errmsg.h"
#include "tcpsrv.h"
MODULE_TYPE_INPUT
@@ -54,6 +55,7 @@ DEFobjCurrIf(tcpsrv)
DEFobjCurrIf(tcps_sess)
DEFobjCurrIf(net)
DEFobjCurrIf(netstrm)
+DEFobjCurrIf(errmsg)
/* Module static data */
static tcpsrv_t *pOurTcpsrv = NULL; /* our TCP server(listener) TODO: change for multiple instances */
@@ -134,6 +136,11 @@ static rsRetVal addTCPListener(void __attribute__((unused)) *pVal, uchar *pNewVa
}
finalize_it:
+ if(iRet != RS_RET_OK) {
+ errmsg.LogError(NO_ERRCODE, "error %d trying to add listener", iRet);
+ if(pOurTcpsrv != NULL)
+ tcpsrv.Destruct(&pOurTcpsrv);
+ }
RETiRet;
}
@@ -179,6 +186,7 @@ CODESTARTmodExit
objRelease(netstrm, LM_NETSTRMS_FILENAME);
objRelease(tcps_sess, LM_TCPSRV_FILENAME);
objRelease(tcpsrv, LM_TCPSRV_FILENAME);
+ objRelease(errmsg, CORE_COMPONENT);
ENDmodExit
@@ -207,6 +215,7 @@ CODEmodInit_QueryRegCFSLineHdlr
CHKiRet(objUse(netstrm, LM_NETSTRMS_FILENAME));
CHKiRet(objUse(tcps_sess, LM_TCPSRV_FILENAME));
CHKiRet(objUse(tcpsrv, LM_TCPSRV_FILENAME));
+ CHKiRet(objUse(errmsg, CORE_COMPONENT));
/* register config file handlers */
CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputtcpserverrun", 0, eCmdHdlrGetWord,