From 56f17d2c9f3d229d701bcf0dda83f4d29c0e02ba Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 15 Jan 2008 22:15:55 +0000 Subject: I made the torture test on test 530 go through. This was actually due to silly code left from when we switched to let the multi handle "hold" the dns cache when using the multi interface... Of course this only triggered when a certain function call returned error at the correct moment. --- lib/hostip.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib/hostip.c') diff --git a/lib/hostip.c b/lib/hostip.c index 55225480c..aa5ec1e00 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -127,14 +127,19 @@ static void freednsentry(void *freethis); * Curl_global_host_cache_init() initializes and sets up a global DNS cache. * Global DNS cache is general badness. Do not use. This will be removed in * a future version. Use the share interface instead! + * + * Returns 0 on success, 1 on failure. */ -void Curl_global_host_cache_init(void) +int Curl_global_host_cache_init(void) { + int rc = 0; if(!host_cache_initialized) { - Curl_hash_init(&hostname_cache, 7, Curl_hash_str, Curl_str_key_compare, - freednsentry); - host_cache_initialized = 1; + rc = Curl_hash_init(&hostname_cache, 7, Curl_hash_str, + Curl_str_key_compare, freednsentry); + if(!rc) + host_cache_initialized = 1; } + return rc; } /* -- cgit v1.2.3