From a55c70d4ae88a15d9a7f726267fa27fe638496a5 Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Fri, 21 Jul 2006 05:51:12 +0000 Subject: Constify 'hostname' and 'service' to various resolver functions. --- lib/hostip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/hostip.c') diff --git a/lib/hostip.c b/lib/hostip.c index 21d2297fa..7146bb2bf 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -196,7 +196,7 @@ const char *Curl_printable_address(const Curl_addrinfo *ip, * the DNS caching. */ static char * -create_hostcache_id(char *server, int port) +create_hostcache_id(const char *server, int port) { /* create and return the new allocated entry */ return aprintf("%s:%d", server, port); @@ -327,7 +327,7 @@ sigjmp_buf curl_jmpenv; struct Curl_dns_entry * Curl_cache_addr(struct SessionHandle *data, Curl_addrinfo *addr, - char *hostname, + const char *hostname, int port) { char *entry_id; @@ -344,7 +344,7 @@ Curl_cache_addr(struct SessionHandle *data, entry_len = strlen(entry_id); /* Create a new cache entry */ - dns = (struct Curl_dns_entry *) malloc(sizeof(struct Curl_dns_entry)); + dns = (struct Curl_dns_entry *) calloc(sizeof(struct Curl_dns_entry), 1); if (!dns) { free(entry_id); return NULL; @@ -394,7 +394,7 @@ Curl_cache_addr(struct SessionHandle *data, */ int Curl_resolv(struct connectdata *conn, - char *hostname, + const char *hostname, int port, struct Curl_dns_entry **entry) { -- cgit v1.2.1