diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | tcps_sess.c | 11 |
2 files changed, 11 insertions, 2 deletions
@@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 4.6.4 [v4-stable] (rgerhards), 2010-??-?? +- bugfix: zero-sized (empty) messages were processed by imtcp + they are now dropped as they always should have been --------------------------------------------------------------------------- Version 4.6.3 [v4-stable] (rgerhards), 2010-07-07 - improvded testbench diff --git a/tcps_sess.c b/tcps_sess.c index dec14b5a..ea9032b3 100644 --- a/tcps_sess.c +++ b/tcps_sess.c @@ -238,6 +238,11 @@ defaultDoSubmitMessage(tcps_sess_t *pThis, struct syslogTime *stTime, time_t ttG ISOBJ_TYPE_assert(pThis, tcps_sess); + if(pThis->iMsg == 0) { + DBGPRINTF("discarding zero-sized message\n"); + FINALIZE; + } + if(pThis->DoSubmitMessage != NULL) { pThis->DoSubmitMessage(pThis, pThis->pMsg, pThis->iMsg); FINALIZE; @@ -477,8 +482,10 @@ DataRcvd(tcps_sess_t *pThis, char *pData, size_t iLen) CHKiRet(processDataRcvd(pThis, *pData++, &stTime, ttGenTime, &multiSub)); } - /* submit anything that was not yet submitted */ - CHKiRet(multiSubmitMsg(&multiSub)); + if(multiSub.nElem > 0) { + /* submit anything that was not yet submitted */ + CHKiRet(multiSubmitMsg(&multiSub)); + } finalize_it: RETiRet; |