summaryrefslogtreecommitdiffstats
path: root/tcpsrv.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-05-02 11:57:29 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-05-02 11:57:29 +0200
commit579c61e579d9452682da51ec5e4b547684573807 (patch)
tree3a35286a2e79affa5b664b1df94f282f4ffe280e /tcpsrv.c
parentd4539663f685910db1e8d7816508298b940c8590 (diff)
downloadrsyslog-579c61e579d9452682da51ec5e4b547684573807.tar.gz
rsyslog-579c61e579d9452682da51ec5e4b547684573807.tar.xz
rsyslog-579c61e579d9452682da51ec5e4b547684573807.zip
bugfix: a slightly more informative error message when a TCP
connections is aborted
Diffstat (limited to 'tcpsrv.c')
-rw-r--r--tcpsrv.c8
1 files changed, 5 insertions, 3 deletions
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]);
}