Merge pull request #3589 from rsyslog/revert-3535-issue-1503

Revert "WiP: rsyslog doesn't respond to TLS close_notify "
This commit is contained in:
Rainer Gerhards 2019-04-05 09:53:05 +02:00 committed by GitHub
commit 1a95406046
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.