From 301f8b23e152780688882e74ce4c593b356659c6 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 17 Jan 2023 13:58:10 -0800 Subject: [PATCH] complete change of NETMGR_TRACE to ISC_NETMGR_TRACE some references to the old ifdef were still in place. --- lib/isc/include/isc/netmgr.h | 9 +++++++-- lib/isc/netmgr/netmgr-int.h | 4 ++-- lib/isc/netmgr/netmgr.c | 4 ++-- lib/isc/netmgr/tlsstream.c | 4 ++-- tests/include/tests/ns.h | 2 +- tests/ns/netmgr_wrap.c | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/isc/include/isc/netmgr.h b/lib/isc/include/isc/netmgr.h index bd81b7bb9d..e41bbdf859 100644 --- a/lib/isc/include/isc/netmgr.h +++ b/lib/isc/include/isc/netmgr.h @@ -148,15 +148,20 @@ isc_nmsocket_set_max_streams(isc_nmsocket_t *listener, * \li 'listener' is a pointer to a valid network manager listener socket. */ -#ifdef ISC_NETMGR_TRACE +#if ISC_NETMGR_TRACE #define isc_nmhandle_attach(handle, dest) \ isc__nmhandle_attach(handle, dest, __FILE__, __LINE__, __func__) #define isc_nmhandle_detach(handlep) \ isc__nmhandle_detach(handlep, __FILE__, __LINE__, __func__) -#define FLARG , const char *file, unsigned int line, const char *func +#define FLARG_PASS , file, line, func +#define FLARG \ + , const char *file __attribute__((unused)), \ + unsigned int line __attribute__((unused)), \ + const char *func __attribute__((unused)) #else #define isc_nmhandle_attach(handle, dest) isc__nmhandle_attach(handle, dest) #define isc_nmhandle_detach(handlep) isc__nmhandle_detach(handlep) +#define FLARG_PASS #define FLARG #endif diff --git a/lib/isc/netmgr/netmgr-int.h b/lib/isc/netmgr/netmgr-int.h index 082bba22b0..8302f67c4b 100644 --- a/lib/isc/netmgr/netmgr-int.h +++ b/lib/isc/netmgr/netmgr-int.h @@ -129,11 +129,11 @@ STATIC_ASSERT(ISC_NETMGR_TCP_RECVBUF_SIZE <= ISC_NETMGR_RECVBUF_SIZE, fprintf(stderr, "%" PRIu32 ":%d:%s:%u:%s:" format, gettid(), \ isc_tid(), file, line, func, __VA_ARGS__) -#define FLARG_PASS , file, line, func #define FLARG \ , const char *file __attribute__((unused)), \ unsigned int line __attribute__((unused)), \ const char *func __attribute__((unused)) +#define FLARG_PASS , file, line, func #define FLARG_IEVENT(ievent) \ const char *file = ievent->file; \ unsigned int line = ievent->line; \ @@ -164,8 +164,8 @@ STATIC_ASSERT(ISC_NETMGR_TCP_RECVBUF_SIZE <= ISC_NETMGR_RECVBUF_SIZE, #else #define NETMGR_TRACE_LOG(format, ...) -#define FLARG_PASS #define FLARG +#define FLARG_PASS #define FLARG_IEVENT(ievent) #define FLARG_IEVENT_PASS(ievent) #define isc__nm_uvreq_get(req, sock) isc___nm_uvreq_get(req, sock) diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 392bf3ceae..4026242c1e 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -632,11 +632,11 @@ nmsocket_cleanup(isc_nmsocket_t *sock) { sock->statichandle = NULL; if (sock->outerhandle != NULL) { - isc__nmhandle_detach(&sock->outerhandle FLARG_PASS); + isc_nmhandle_detach(&sock->outerhandle); } if (sock->outer != NULL) { - isc___nmsocket_detach(&sock->outer FLARG_PASS); + isc__nmsocket_detach(&sock->outer); } while ((handle = ISC_LIST_HEAD(sock->inactive_handles)) != NULL) { diff --git a/lib/isc/netmgr/tlsstream.c b/lib/isc/netmgr/tlsstream.c index 7affda4d14..dbe992fe7c 100644 --- a/lib/isc/netmgr/tlsstream.c +++ b/lib/isc/netmgr/tlsstream.c @@ -509,7 +509,7 @@ tls_do_bio(isc_nmsocket_t *sock, isc_region_t *received_data, received_data->length, &len); if (rv <= 0 || len != received_data->length) { result = ISC_R_TLSERROR; -#if defined(NETMGR_TRACE) && defined(NETMGR_TRACE_VERBOSE) +#if ISC_NETMGR_TRACE saved_errno = errno; #endif goto error; @@ -744,7 +744,7 @@ tls_do_bio(isc_nmsocket_t *sock, isc_region_t *received_data, } error: -#if defined(NETMGR_TRACE) && defined(NETMGR_TRACE_VERBOSE) +#if ISC_NETMGR_TRACE isc__nmsocket_log(sock, ISC_LOG_NOTICE, "SSL error in BIO: %d %s (errno: %d). Arguments: " "received_data: %p, " diff --git a/tests/include/tests/ns.h b/tests/include/tests/ns.h index 93480e27fa..8738a57fb6 100644 --- a/tests/include/tests/ns.h +++ b/tests/include/tests/ns.h @@ -54,7 +54,7 @@ extern ns_server_t *sctx; extern atomic_uint_fast32_t client_refs[32]; extern atomic_uintptr_t client_addrs[32]; -#ifdef NETMGR_TRACE +#if ISC_NETMGR_TRACE #define FLARG \ , const char *file __attribute__((unused)), \ unsigned int line __attribute__((unused)), \ diff --git a/tests/ns/netmgr_wrap.c b/tests/ns/netmgr_wrap.c index 076d9954bf..e347b0612a 100644 --- a/tests/ns/netmgr_wrap.c +++ b/tests/ns/netmgr_wrap.c @@ -21,7 +21,7 @@ #include -#ifdef NETMGR_TRACE +#if ISC_NETMGR_TRACE #define FLARG \ , const char *file __attribute__((unused)), \ unsigned int line __attribute__((unused)), \