From 246e95fe9095b0f36824cdd75017b65850b08e9b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 21 Jan 2026 03:28:02 +0100 Subject: [PATCH 1/2] urldata.h: delete orphan forward declaration Closes #20380 --- lib/urldata.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/urldata.h b/lib/urldata.h index f423d3376739..667561f155a5 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -52,8 +52,6 @@ #define PORT_MQTT 1883 #define PORT_MQTTS 8883 -struct curl_trc_featt; - #ifdef USE_ECH /* CURLECH_ bits for the tls_ech option */ # define CURLECH_DISABLE (1 << 0) From 066ed13ca44155eeffd72da67f02a81956af667b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 21 Jan 2026 03:31:41 +0100 Subject: [PATCH 2/2] hostip: omit forward declaration of verbose logging function Closes #20381 --- lib/hostip.c | 127 +++++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 66 deletions(-) diff --git a/lib/hostip.c b/lib/hostip.c index 2bb8638ef54b..bd00efff6193 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -116,7 +116,67 @@ #ifndef CURL_DISABLE_VERBOSE_STRINGS static void show_resolve_info(struct Curl_easy *data, - struct Curl_dns_entry *dns); + struct Curl_dns_entry *dns) +{ + struct Curl_addrinfo *a; + CURLcode result = CURLE_OK; +#ifdef CURLRES_IPV6 + struct dynbuf out[2]; +#else + struct dynbuf out[1]; +#endif + DEBUGASSERT(data); + DEBUGASSERT(dns); + + if(!data->set.verbose || + /* ignore no name or numerical IP addresses */ + !dns->hostname[0] || Curl_host_is_ipnum(dns->hostname)) + return; + + a = dns->addr; + + infof(data, "Host %s:%d was resolved.", + (dns->hostname[0] ? dns->hostname : "(none)"), dns->hostport); + + curlx_dyn_init(&out[0], 1024); +#ifdef CURLRES_IPV6 + curlx_dyn_init(&out[1], 1024); +#endif + + while(a) { + if( +#ifdef CURLRES_IPV6 + a->ai_family == PF_INET6 || +#endif + a->ai_family == PF_INET) { + char buf[MAX_IPADR_LEN]; + struct dynbuf *d = &out[(a->ai_family != PF_INET)]; + Curl_printable_address(a, buf, sizeof(buf)); + if(curlx_dyn_len(d)) + result = curlx_dyn_addn(d, ", ", 2); + if(!result) + result = curlx_dyn_add(d, buf); + if(result) { + infof(data, "too many IP, cannot show"); + goto fail; + } + } + a = a->ai_next; + } + +#ifdef CURLRES_IPV6 + infof(data, "IPv6: %s", + (curlx_dyn_len(&out[1]) ? curlx_dyn_ptr(&out[1]) : "(none)")); +#endif + infof(data, "IPv4: %s", + (curlx_dyn_len(&out[0]) ? curlx_dyn_ptr(&out[0]) : "(none)")); + +fail: + curlx_dyn_free(&out[0]); +#ifdef CURLRES_IPV6 + curlx_dyn_free(&out[1]); +#endif +} #else #define show_resolve_info(x, y) Curl_nop_stmt #endif @@ -1422,71 +1482,6 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) return CURLE_OK; } -#ifndef CURL_DISABLE_VERBOSE_STRINGS -static void show_resolve_info(struct Curl_easy *data, - struct Curl_dns_entry *dns) -{ - struct Curl_addrinfo *a; - CURLcode result = CURLE_OK; -#ifdef CURLRES_IPV6 - struct dynbuf out[2]; -#else - struct dynbuf out[1]; -#endif - DEBUGASSERT(data); - DEBUGASSERT(dns); - - if(!data->set.verbose || - /* ignore no name or numerical IP addresses */ - !dns->hostname[0] || Curl_host_is_ipnum(dns->hostname)) - return; - - a = dns->addr; - - infof(data, "Host %s:%d was resolved.", - (dns->hostname[0] ? dns->hostname : "(none)"), dns->hostport); - - curlx_dyn_init(&out[0], 1024); -#ifdef CURLRES_IPV6 - curlx_dyn_init(&out[1], 1024); -#endif - - while(a) { - if( -#ifdef CURLRES_IPV6 - a->ai_family == PF_INET6 || -#endif - a->ai_family == PF_INET) { - char buf[MAX_IPADR_LEN]; - struct dynbuf *d = &out[(a->ai_family != PF_INET)]; - Curl_printable_address(a, buf, sizeof(buf)); - if(curlx_dyn_len(d)) - result = curlx_dyn_addn(d, ", ", 2); - if(!result) - result = curlx_dyn_add(d, buf); - if(result) { - infof(data, "too many IP, cannot show"); - goto fail; - } - } - a = a->ai_next; - } - -#ifdef CURLRES_IPV6 - infof(data, "IPv6: %s", - (curlx_dyn_len(&out[1]) ? curlx_dyn_ptr(&out[1]) : "(none)")); -#endif - infof(data, "IPv4: %s", - (curlx_dyn_len(&out[0]) ? curlx_dyn_ptr(&out[0]) : "(none)")); - -fail: - curlx_dyn_free(&out[0]); -#ifdef CURLRES_IPV6 - curlx_dyn_free(&out[1]); -#endif -} -#endif - #ifdef USE_CURL_ASYNC CURLcode Curl_resolv_check(struct Curl_easy *data, struct Curl_dns_entry **dns)