summaryrefslogtreecommitdiffstats
path: root/runtime/netstrm.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-06-09 12:40:54 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-06-09 12:40:54 +0200
commit55e01da2ec3de1b5c6b15e4154235f0eedbb68da (patch)
treefe7b9b9b114c982d1453a363499bad9fa323fd1a /runtime/netstrm.c
parentcf51333f7617e586ca1d4cf5202e3d42f14c96ea (diff)
downloadrsyslog-55e01da2ec3de1b5c6b15e4154235f0eedbb68da.tar.gz
rsyslog-55e01da2ec3de1b5c6b15e4154235f0eedbb68da.tar.xz
rsyslog-55e01da2ec3de1b5c6b15e4154235f0eedbb68da.zip
somewhat improved plain tcp syslog reliability
...by doing a connection check before sending. Credits to Martin Schuette for providing the idea. Details are available at http://blog.gerhards.net/2008/06/reliable-plain-tcp-syslog-once-again.html
Diffstat (limited to 'runtime/netstrm.c')
-rw-r--r--runtime/netstrm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/netstrm.c b/runtime/netstrm.c
index 786ba7f8..2f4a1964 100644
--- a/runtime/netstrm.c
+++ b/runtime/netstrm.c
@@ -234,6 +234,15 @@ Send(netstrm_t *pThis, uchar *pBuf, ssize_t *pLenBuf)
}
+/* check connection - slim wrapper for NSD driver function */
+static void
+CheckConnection(netstrm_t *pThis)
+{
+ ISOBJ_TYPE_assert(pThis, netstrm);
+ pThis->Drvr.CheckConnection(pThis->pDrvrData);
+}
+
+
/* get remote hname - slim wrapper for NSD driver function */
static rsRetVal
GetRemoteHName(netstrm_t *pThis, uchar **ppsz)
@@ -314,6 +323,7 @@ CODESTARTobjQueryInterface(netstrm)
pIf->SetDrvrMode = SetDrvrMode;
pIf->SetDrvrAuthMode = SetDrvrAuthMode;
pIf->SetDrvrPermPeers = SetDrvrPermPeers;
+ pIf->CheckConnection = CheckConnection;
pIf->GetSock = GetSock;
finalize_it:
ENDobjQueryInterface(netstrm)