diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-01-15 22:15:55 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-01-15 22:15:55 +0000 |
commit | 56f17d2c9f3d229d701bcf0dda83f4d29c0e02ba (patch) | |
tree | da73dc3c74a6b29c4c0894a15aa263a88a7fd31a /lib/hostip.c | |
parent | 19ae96f4d0086f45705a6d4e106e1f66ab03baf7 (diff) |
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.
Diffstat (limited to 'lib/hostip.c')
-rw-r--r-- | lib/hostip.c | 15 |
1 files changed, 10 insertions, 5 deletions
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, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, 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; } /* |