From ea89ab80ae3594b45ab751ae6b249e64e59ddf60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 28 Dec 2021 15:09:50 +0100 Subject: [PATCH] Fix error codes passed to connection callbacks Commit 9ee60e7a17bf34c7ef7f4d79e6a00ca45444ec8c erroneously introduced duplicate conditions to several existing conditional statements responsible for determining error codes passed to connection callbacks upon failure. Fix the affected expressions to ensure connection callbacks are invoked with: - the ISC_R_SHUTTINGDOWN error code when a global netmgr shutdown is in progress, - the ISC_R_CANCELED error code when a specific operation has been canceled. This does not fix any known bugs, it only adjusts the changes introduced by commit 9ee60e7a17bf34c7ef7f4d79e6a00ca45444ec8c so that they match its original intent. --- 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 eb6437d8d4..b818f41a20 100644 --- a/lib/isc/netmgr/tcp.c +++ b/lib/isc/netmgr/tcp.c @@ -247,7 +247,7 @@ tcp_connect_cb(uv_connect_t *uvreq, int status) { */ isc__nm_uvreq_put(&req, sock); return; - } else if (isc__nmsocket_closing(sock)) { + } else if (isc__nm_closing(sock)) { /* Network manager shutting down */ result = ISC_R_SHUTTINGDOWN; goto error; diff --git a/lib/isc/netmgr/tcpdns.c b/lib/isc/netmgr/tcpdns.c index 9167e52bb5..ebb1ec8e8f 100644 --- a/lib/isc/netmgr/tcpdns.c +++ b/lib/isc/netmgr/tcpdns.c @@ -214,7 +214,7 @@ tcpdns_connect_cb(uv_connect_t *uvreq, int status) { REQUIRE(VALID_UVREQ(req)); REQUIRE(VALID_NMHANDLE(req->handle)); - if (isc__nmsocket_closing(sock)) { + if (isc__nm_closing(sock)) { /* Network manager shutting down */ result = ISC_R_SHUTTINGDOWN; goto error; diff --git a/lib/isc/netmgr/tlsdns.c b/lib/isc/netmgr/tlsdns.c index 137a1709cd..0e34b95011 100644 --- a/lib/isc/netmgr/tlsdns.c +++ b/lib/isc/netmgr/tlsdns.c @@ -230,7 +230,7 @@ tlsdns_connect_cb(uv_connect_t *uvreq, int status) { REQUIRE(VALID_UVREQ(req)); REQUIRE(VALID_NMHANDLE(req->handle)); - if (isc__nmsocket_closing(sock)) { + if (isc__nm_closing(sock)) { /* Network manager shutting down */ result = ISC_R_SHUTTINGDOWN; goto error;