Revert "WiP: rsyslog doesn't respond to TLS close_notify "

This commit is contained in:
Rainer Gerhards 2019-04-04 15:59:07 +02:00 committed by GitHub
parent 393ce8a5a1
commit 7386336340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -896,12 +896,12 @@ CheckConnection(nsd_t *pNsd)
{
DEFiRet;
int rc;
char msgbuf[32]; /* dummy */
char msgbuf[1]; /* dummy */
nsd_ptcp_t *pThis = (nsd_ptcp_t*) pNsd;
ISOBJ_TYPE_assert(pThis, nsd_ptcp);
rc = recv(pThis->sock, msgbuf, 32, MSG_DONTWAIT | MSG_PEEK);
if(rc >= 0 && errno != EAGAIN) {
rc = recv(pThis->sock, msgbuf, 1, MSG_DONTWAIT | MSG_PEEK);
if(rc == 0 && errno != EAGAIN) {
dbgprintf("CheckConnection detected broken connection - closing it\n");
/* in this case, the remote peer had shut down the connection and we
* need to close our side, too.