summaryrefslogtreecommitdiffstats
path: root/tcpsrv.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-14 17:03:14 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-14 17:03:14 +0000
commitb0e8ce6c3d48e664135a0f74d5b4df2b3a42827f (patch)
treeb564ab5c477c194de8985d9c97a048b7fb95629c /tcpsrv.c
parent38362e127f7b7b836332bf17097dbbae71bbe810 (diff)
downloadrsyslog-b0e8ce6c3d48e664135a0f74d5b4df2b3a42827f.tar.gz
rsyslog-b0e8ce6c3d48e664135a0f74d5b4df2b3a42827f.tar.xz
rsyslog-b0e8ce6c3d48e664135a0f74d5b4df2b3a42827f.zip
bugfix: TCP (and GSSAPI) octet-counted frame did not work correctly in all
situations. If the header was split across two packet reads, it was invalidly processed, causing loss or modification of messages.
Diffstat (limited to 'tcpsrv.c')
-rw-r--r--tcpsrv.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tcpsrv.c b/tcpsrv.c
index f3fad684..4553656e 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -612,13 +612,12 @@ Run(tcpsrv_t *pThis)
tcps_sess.Destruct(&pThis->pSessions[iTCPSess]);
} else {
/* valid data received, process it! */
- if(tcps_sess.DataRcvd(pThis->pSessions[iTCPSess], buf, state) == 0) {
+ if(tcps_sess.DataRcvd(pThis->pSessions[iTCPSess], buf, state) != RS_RET_OK) {
/* in this case, something went awfully wrong.
* We are instructed to terminate the session.
*/
errmsg.LogError(NO_ERRCODE, "Tearing down TCP Session %d - see "
- "previous messages for reason(s)\n",
- iTCPSess);
+ "previous messages for reason(s)\n", iTCPSess);
pThis->pOnErrClose(pThis->pSessions[iTCPSess]);
tcps_sess.Destruct(&pThis->pSessions[iTCPSess]);
}