From: Ondřej Surý Date: Wed, 21 Oct 2020 22:17:03 +0000 (+0200) Subject: Ignore and don't log ISC_R_NOTCONNECTED from uv_accept() X-Git-Tag: v9.17.7~46^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ef71c420fc118b506ad5a16bdb4a21fafdcda9c;p=thirdparty%2Fbind9.git Ignore and don't log ISC_R_NOTCONNECTED from uv_accept() When client disconnects before the connection can be accepted, the named would log a spurious log message: error: Accepting TCP connection failed: socket is not connected We now ignore the ISC_R_NOTCONNECTED result code and log only other errors --- diff --git a/lib/isc/netmgr/tcp.c b/lib/isc/netmgr/tcp.c index 5129e1d4a54..ef575ee5022 100644 --- a/lib/isc/netmgr/tcp.c +++ b/lib/isc/netmgr/tcp.c @@ -517,9 +517,17 @@ error: if (sock->quota != NULL) { isc_quota_detach(&sock->quota); } - isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_NETMGR, - ISC_LOG_ERROR, "Accepting TCP connection failed: %s", - isc_result_totext(result)); + + switch (result) { + case ISC_R_NOTCONNECTED: + /* IGNORE: The client disconnected before we could accept */ + break; + default: + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, + ISC_LOGMODULE_NETMGR, ISC_LOG_ERROR, + "Accepting TCP connection failed: %s", + isc_result_totext(result)); + } /* * Detach the socket properly to make sure uv_close() is called.