From d13ec67f9ab9c59a88952af6aec372fd082401ca Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 2 May 2011 12:03:42 +0200 Subject: slightly more informative errmsg when TCP connection is aborted --- tcpsrv.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tcpsrv.c') diff --git a/tcpsrv.c b/tcpsrv.c index 0102bee7..5de805b2 100644 --- a/tcpsrv.c +++ b/tcpsrv.c @@ -471,6 +471,7 @@ static rsRetVal Run(tcpsrv_t *pThis) { DEFiRet; + rsRetVal localRet; int nfds; int i; int iTCPSess; @@ -545,12 +546,13 @@ Run(tcpsrv_t *pThis) break; case RS_RET_OK: /* valid data received, process it! */ - if(tcps_sess.DataRcvd(pThis->pSessions[iTCPSess], buf, iRcvd) != RS_RET_OK) { + localRet = tcps_sess.DataRcvd(pThis->pSessions[iTCPSess], buf, iRcvd); + if(localRet != RS_RET_OK) { /* in this case, something went awfully wrong. * We are instructed to terminate the session. */ - errmsg.LogError(0, NO_ERRCODE, "Tearing down TCP Session %d - see " - "previous messages for reason(s)\n", iTCPSess); + errmsg.LogError(0, localRet, "Tearing down TCP Session %d - see " + "previous messages for reason(s)", iTCPSess); pThis->pOnErrClose(pThis->pSessions[iTCPSess]); tcps_sess.Destruct(&pThis->pSessions[iTCPSess]); } -- cgit From 921bebc8ee203c0569332c636515c4de036dfcf9 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 2 May 2011 12:43:58 +0200 Subject: bugfix: TCP connection invalidly aborted when messages needed to be discarded due to QUEUE_FULL or similar problem --- tcpsrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tcpsrv.c') diff --git a/tcpsrv.c b/tcpsrv.c index 5de805b2..0581828e 100644 --- a/tcpsrv.c +++ b/tcpsrv.c @@ -547,7 +547,7 @@ Run(tcpsrv_t *pThis) case RS_RET_OK: /* valid data received, process it! */ localRet = tcps_sess.DataRcvd(pThis->pSessions[iTCPSess], buf, iRcvd); - if(localRet != RS_RET_OK) { + if(localRet != RS_RET_OK && localRet != RS_RET_QUEUE_FULL) { /* in this case, something went awfully wrong. * We are instructed to terminate the session. */ -- cgit