From b0e8ce6c3d48e664135a0f74d5b4df2b3a42827f Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 14 Mar 2008 17:03:14 +0000 Subject: 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. --- tcpsrv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tcpsrv.c') 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]); } -- cgit