RequestServer: Remove unused global "g_dns_cache"

`curl_slist_append` copies the string so we don't need to keep it around
ourselves.
This commit is contained in:
rmg-x 2024-11-30 17:05:50 -06:00 committed by Andreas Kling
commit 32358df13e
Notes: github-actions[bot] 2024-12-01 10:36:36 +00:00

View file

@ -26,7 +26,6 @@ ByteString g_default_certificate_path;
static HashMap<int, RefPtr<ConnectionFromClient>> s_connections;
static IDAllocator s_client_ids;
static long s_connect_timeout_seconds = 90L;
static HashMap<ByteString, ByteString> g_dns_cache; // host -> curl "resolve" string
static struct {
Optional<Core::SocketAddress> server_address;
Optional<ByteString> server_hostname;
@ -447,7 +446,6 @@ void ConnectionFromClient::start_request(i32 request_id, ByteString const& metho
}
auto formatted_address = resolve_opt_builder.to_byte_string();
g_dns_cache.set(host, formatted_address);
curl_slist* resolve_list = curl_slist_append(nullptr, formatted_address.characters());
curl_easy_setopt(easy, CURLOPT_RESOLVE, resolve_list);