diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-02 13:11:18 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-02 13:11:18 +0200 |
commit | b61e5fffc42c98b49a18a95c297653fb0ba06b72 (patch) | |
tree | 48dec238d72f866ce520fedbdb0cc0f82bfed943 /runtime/strmsrv.c | |
parent | 05ba5fc29fb13857b6fbb7c8f3c22489da3e73cf (diff) | |
download | rsyslog-b61e5fffc42c98b49a18a95c297653fb0ba06b72.tar.gz rsyslog-b61e5fffc42c98b49a18a95c297653fb0ba06b72.tar.xz rsyslog-b61e5fffc42c98b49a18a95c297653fb0ba06b72.zip |
strmsrv now supports KEEPALIVE socket option
Diffstat (limited to 'runtime/strmsrv.c')
-rw-r--r-- | runtime/strmsrv.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/strmsrv.c b/runtime/strmsrv.c index 6c803ee2..3dc53a97 100644 --- a/runtime/strmsrv.c +++ b/runtime/strmsrv.c @@ -434,6 +434,10 @@ SessAccept(strmsrv_t *pThis, strmLstnPortList_t *pLstnInfo, strms_sess_t **ppSes ABORT_FINALIZE(RS_RET_MAX_SESS_REACHED); } + if(pThis->bUseKeepAlive) { + CHKiRet(netstrm.EnableKeepAlive(pNewStrm)); + } + /* we found a free spot and can construct our session object */ CHKiRet(strms_sess.Construct(&pSess)); CHKiRet(strms_sess.SetStrmsrv(pSess, pThis)); @@ -757,6 +761,15 @@ SetUsrP(strmsrv_t *pThis, void *pUsr) } static rsRetVal +SetKeepAlive(strmsrv_t *pThis, int iVal) +{ + DEFiRet; + dbgprintf("keep-alive set to %d\n", iVal); + pThis->bUseKeepAlive = iVal; + RETiRet; +} + +static rsRetVal SetOnCharRcvd(strmsrv_t *pThis, rsRetVal (*OnCharRcvd)(strms_sess_t*, uchar)) { DEFiRet; @@ -864,6 +877,7 @@ CODESTARTobjQueryInterface(strmsrv) pIf->create_strm_socket = create_strm_socket; pIf->Run = Run; + pIf->SetKeepAlive = SetKeepAlive; pIf->SetUsrP = SetUsrP; pIf->SetInputName = SetInputName; pIf->SetSessMax = SetSessMax; |