From 55e01da2ec3de1b5c6b15e4154235f0eedbb68da Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 9 Jun 2008 12:40:54 +0200 Subject: 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 --- runtime/netstrm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'runtime/netstrm.c') 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) -- cgit