summaryrefslogtreecommitdiffstats
path: root/tcpclt.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-08-21 10:37:59 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-08-21 10:37:59 +0200
commit596383988792635f128cb645c9b7c8aae50453e6 (patch)
tree5e5ba6dc03b6e9b687b09f49828b5a1fcdda1cda /tcpclt.c
parent8624f937523c1ca78cc1d78b8eba18f628ae9ab5 (diff)
parentdaa76ad94428599336ddafdd6854dc0b71356180 (diff)
downloadrsyslog-596383988792635f128cb645c9b7c8aae50453e6.tar.gz
rsyslog-596383988792635f128cb645c9b7c8aae50453e6.tar.xz
rsyslog-596383988792635f128cb645c9b7c8aae50453e6.zip
Merge branch 'v4-devel' into v4-beta
Diffstat (limited to 'tcpclt.c')
-rw-r--r--tcpclt.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tcpclt.c b/tcpclt.c
index c53f00f7..617aaef6 100644
--- a/tcpclt.c
+++ b/tcpclt.c
@@ -297,6 +297,12 @@ Send(tcpclt_t *pThis, void *pData, char *msg, size_t len)
CHKiRet(TCPSendBldFrame(pThis, &msg, &len, &bMsgMustBeFreed));
+ if(pThis->iRebindInterval > 0 && ++pThis->iNumMsgs == pThis->iRebindInterval) {
+ /* we need to rebind, and use the retry logic for this*/
+ CHKiRet(pThis->prepRetryFunc(pData)); /* try to recover */
+ pThis->iNumMsgs = 0;
+ }
+
while(!bDone) { /* loop is broken when send succeeds or error occurs */
CHKiRet(pThis->initFunc(pData));
iRet = pThis->sendFunc(pData, msg, len);
@@ -388,6 +394,13 @@ SetFraming(tcpclt_t *pThis, TCPFRAMINGMODE framing)
pThis->tcp_framing = framing;
RETiRet;
}
+static rsRetVal
+SetRebindInterval(tcpclt_t *pThis, int iRebindInterval)
+{
+ DEFiRet;
+ pThis->iRebindInterval = iRebindInterval;
+ RETiRet;
+}
/* Standard-Constructor
@@ -445,6 +458,7 @@ CODESTARTobjQueryInterface(tcpclt)
pIf->SetSendFrame = SetSendFrame;
pIf->SetSendPrepRetry = SetSendPrepRetry;
pIf->SetFraming = SetFraming;
+ pIf->SetRebindInterval = SetRebindInterval;
finalize_it:
ENDobjQueryInterface(tcpclt)