DOKK / manpages / debian 12 / wget2-dev / libwget-dns-caching.3.en
libwget-dns-caching(3) wget2 libwget-dns-caching(3)

libwget-dns-caching - DNS caching


void wget_dns_cache_init (void)
void wget_dns_cache_exit (void)
struct addrinfo * wget_dns_cache_get (const char *host, uint16_t port)
struct addrinfo * wget_dns_cache_add (const char *host, uint16_t port, struct addrinfo *addrinfo)
void wget_dns_cache_free (void)

DNS cache management functions.

Initialize the internal mutex needed for thread-safety operations on the cache entry container (hashmap). If you don't use multi-threading, you don't have to call this function.

The initialization is normally automatically during library construction. But some systems doesn't support library constructors, also static linking doesn't do. That's where this function is needed.

Free the internal mutex allocated by wget_dns_cache_init().

Parameters

host Hostname to look up
port Port to look up

Returns

The cached addrinfo structure or NULL if not found

Parameters

host Hostname part of the key
port Port part of the key
addrinfo Addrinfo structure to cache

Returns

The cached addrinfo structure or NULL if not found

Free the DNS cache.

The DNS cache is kept internally in memory. This function releases all its entries and then removes the cache itself, thus freeing memory.

The cache will be re-generated again when calling wget_tcp_resolve(), if the tcp->caching flag was set.

Generated automatically by Doxygen for wget2 from the source code.

Tue Jan 26 2021 Version 1.99.1