aboutsummaryrefslogtreecommitdiff
path: root/lib/hostip.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-11-05 10:51:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-11-05 10:51:41 +0000
commit2cff2518631fc538c127c1e94c47c743e2a64661 (patch)
treeaa0b3b2ff5b198878fc6df6128e5e4910ca7f879 /lib/hostip.h
parent73d996bf265b737e289a18635fb0b3e69d8d7403 (diff)
Curl_resolv() now returns a different struct, and it contains a reference
counter so that the caller needs to decrease that counter when done with the returned data. If compiled with MALLOCDEBUG I've added some extra checking that the counter is decreased before a handle is closed etc.
Diffstat (limited to 'lib/hostip.h')
-rw-r--r--lib/hostip.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/hostip.h b/lib/hostip.h
index 512b27ebf..2593bc343 100644
--- a/lib/hostip.h
+++ b/lib/hostip.h
@@ -23,6 +23,7 @@
* $Id$
***************************************************************************/
+#include "setup.h"
#include "hash.h"
struct addrinfo;
@@ -35,15 +36,23 @@ curl_hash *Curl_global_host_cache_get(void);
#define Curl_global_host_cache_use(__p) ((__p)->set.global_dns_cache)
-Curl_addrinfo *Curl_resolv(struct SessionHandle *data,
- char *hostname,
- int port);
+struct Curl_dns_entry {
+ Curl_addrinfo *addr;
+ time_t timestamp;
+ long inuse; /* use-counter, make very sure you decrease this
+ when you're done using the address you received */
+#ifdef MALLOCDEBUG
+ char *entry_id;
+#endif
+};
+
+struct Curl_dns_entry *Curl_resolv(struct SessionHandle *data,
+ char *hostname,
+ int port);
+
+/* for debugging purposes only: */
+void Curl_scan_cache_used(void *user, void *ptr);
-/* Get name info */
-Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
- char *hostname,
- int port,
- char **bufp);
/* free name info */
void Curl_freeaddrinfo(void *freethis);