summaryrefslogtreecommitdiffstats
path: root/tcps_sess.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-07-28 18:20:13 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2010-07-28 18:20:13 +0200
commit3c1895a699f7d37b49f41f6f758ead4abea0caf2 (patch)
treec6566f2c3193ef7bd2d9f6b8aae5c5f518a14a14 /tcps_sess.c
parent707df8c1618036c09d216f482161e28692d57989 (diff)
downloadrsyslog-3c1895a699f7d37b49f41f6f758ead4abea0caf2.zip
rsyslog-3c1895a699f7d37b49f41f6f758ead4abea0caf2.tar.gz
rsyslog-3c1895a699f7d37b49f41f6f758ead4abea0caf2.tar.xz
bugfix: zero-sized (empty) messages were processed by imtcp
they are now dropped as they always should have been
Diffstat (limited to 'tcps_sess.c')
-rw-r--r--tcps_sess.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tcps_sess.c b/tcps_sess.c
index dec14b5..ea9032b 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;