Changelog
+Daniel S (15 Jan 2008)
+- 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.
+
Daniel S (14 Jan 2008)
- Joe Malicki filed bug report #1871269
(http://curl.haxx.se/bug/view.cgi?id=1871269) and we could fix his hang-
15.3 size_t
15.4 remove several functions
15.5 remove CURLOPT_FAILONERROR
+ 15.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
==============================================================================
Remove support for CURLOPT_FAILONERROR, it has gotten too kludgy and weird
internally. Let the app judge success or not for itself.
+
+15.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
+
+ Remove support for a global DNS cache. Anything global is silly, and we
+ already offer the share interface for the same functionality but done
+ "right".
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * 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
* 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;
}
/*
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * 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
struct SessionHandle;
struct connectdata;
-void Curl_global_host_cache_init(void);
+/*
+ * 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.
+ */
+int Curl_global_host_cache_init(void);
void Curl_global_host_cache_dtor(void);
struct curl_hash *Curl_global_host_cache_get(void);
-#define Curl_global_host_cache_use(__p) ((__p)->set.global_dns_cache)
+#define Curl_global_host_cache_use(__p) \
+ ((__p)->dns.hostcachetype == HCACHE_GLOBAL)
struct Curl_dns_entry {
Curl_addrinfo *addr;
return CURLE_OK;
}
- if( ! (data->share && data->share->hostcache) ) {
- if( !Curl_global_host_cache_use(data)) {
- Curl_hash_destroy(data->dns.hostcache);
- }
- }
+ if(data->dns.hostcachetype == HCACHE_PRIVATE)
+ Curl_hash_destroy(data->dns.hostcache);
if(data->state.rangestringalloc)
free(data->state.range);
case CURLOPT_DNS_USE_GLOBAL_CACHE:
{
long use_cache = va_arg(param, long);
- if(use_cache)
+ if(use_cache) {
Curl_global_host_cache_init();
-
- data->set.global_dns_cache = (bool)(0 != use_cache);
+ data->dns.hostcachetype = HCACHE_GLOBAL;
+ }
+ else
+ /* not global makes it private by default then */
+ data->dns.hostcachetype = HCACHE_PRIVATE;
}
break;
case CURLOPT_SSL_CIPHER_LIST:
curl_ftpauth ftpsslauth; /* what AUTH XXX to be attempted */
curl_ftpccc ftp_ccc; /* FTP CCC options */
bool no_signal; /* do not use any signal/alarm handler */
- bool global_dns_cache; /* subject for future removal */
bool tcp_nodelay; /* whether to enable TCP_NODELAY or not */
bool ignorecl; /* ignore content length */
bool ftp_skip_ip; /* skip the IP address the FTP server passes on to