From 66eb98bb0a3d171b91c77f8a536011f6b25c1adc Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 11 Nov 2002 22:36:00 +0000 Subject: unlock dns cache entries with a function call instead of a variable fiddle --- lib/hostip.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/hostip.h') diff --git a/lib/hostip.h b/lib/hostip.h index 2593bc343..78a17e2e8 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -46,10 +46,21 @@ struct Curl_dns_entry { #endif }; +/* + * Curl_resolv() returns an entry with the info for the specified host + * and port. + * + * The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after + * use, or we'll leak memory! + */ + struct Curl_dns_entry *Curl_resolv(struct SessionHandle *data, char *hostname, int port); +/* unlock a previously resolved dns entry */ +#define Curl_resolv_unlock(dns) dns->inuse-- + /* for debugging purposes only: */ void Curl_scan_cache_used(void *user, void *ptr); -- cgit v1.2.3