From 2ae84702ad0482cbbd5da4113b47d63b23ffe386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 1 Feb 2022 18:36:12 +0100 Subject: [PATCH] Add log message when hard quota is reached in TCP accept When isc_quota_attach_cb() API returns ISC_R_QUOTA (meaning hard quota was reached) the accept_connection() would return without logging a message about quota reached. Change the connection callback to log the quota reached message. --- lib/isc/netmgr/tcp.c | 2 +- lib/isc/netmgr/tcpdns.c | 2 +- lib/isc/netmgr/tlsdns.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/isc/netmgr/tcp.c b/lib/isc/netmgr/tcp.c index d97c2b486c..b0034b9cbf 100644 --- a/lib/isc/netmgr/tcp.c +++ b/lib/isc/netmgr/tcp.c @@ -628,7 +628,7 @@ tcp_connection_cb(uv_stream_t *server, int status) { &ssock->quotacb); if (result == ISC_R_QUOTA) { isc__nm_incstats(ssock, STATID_ACCEPTFAIL); - return; + goto done; } } diff --git a/lib/isc/netmgr/tcpdns.c b/lib/isc/netmgr/tcpdns.c index 8999207e0a..21d1ab5bc6 100644 --- a/lib/isc/netmgr/tcpdns.c +++ b/lib/isc/netmgr/tcpdns.c @@ -597,7 +597,7 @@ tcpdns_connection_cb(uv_stream_t *server, int status) { &ssock->quotacb); if (result == ISC_R_QUOTA) { isc__nm_incstats(ssock, STATID_ACCEPTFAIL); - return; + goto done; } } diff --git a/lib/isc/netmgr/tlsdns.c b/lib/isc/netmgr/tlsdns.c index 135a854662..d56c82857a 100644 --- a/lib/isc/netmgr/tlsdns.c +++ b/lib/isc/netmgr/tlsdns.c @@ -670,7 +670,7 @@ tlsdns_connection_cb(uv_stream_t *server, int status) { &ssock->quotacb); if (result == ISC_R_QUOTA) { isc__nm_incstats(ssock, STATID_ACCEPTFAIL); - return; + goto done; } }