From ead2e13a8e26b517f29e90bf953e298de3cb2eb0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 27 May 2026 15:40:12 +0200 Subject: [PATCH] dnscache: remove Curl_dns_entry_link Unused function Closes #21774 --- lib/dnscache.c | 14 -------------- lib/dnscache.h | 5 ----- 2 files changed, 19 deletions(-) diff --git a/lib/dnscache.c b/lib/dnscache.c index 20f6b21714..82114b4920 100644 --- a/lib/dnscache.c +++ b/lib/dnscache.c @@ -616,20 +616,6 @@ CURLcode Curl_dnscache_add_negative(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; } -struct Curl_dns_entry *Curl_dns_entry_link(struct Curl_easy *data, - struct Curl_dns_entry *dns) -{ - if(!dns) - return NULL; - else { - struct Curl_dnscache *dnscache = dnscache_get(data); - dnscache_lock(data, dnscache); - dns->refcount++; - dnscache_unlock(data, dnscache); - return dns; - } -} - /* * Curl_dns_entry_unlink() releases a reference to the given cached DNS entry. * When the reference count reaches 0, the entry is destroyed. It is important diff --git a/lib/dnscache.h b/lib/dnscache.h index ebe25f6dd4..9239977cf8 100644 --- a/lib/dnscache.h +++ b/lib/dnscache.h @@ -80,11 +80,6 @@ void Curl_dns_entry_set_https_rr(struct Curl_dns_entry *dns, struct Curl_https_rrinfo *hinfo); #endif /* USE_HTTPSRR */ -/* Increase the ref counter and return it for storing in another place. - * May be called with NULL, in which case it returns NULL. */ -struct Curl_dns_entry *Curl_dns_entry_link(struct Curl_easy *data, - struct Curl_dns_entry *dns); - /* unlink a dns entry, frees all resources if it was the last reference. * Always clears `*pdns`` */ void Curl_dns_entry_unlink(struct Curl_easy *data,