}
if (!data->hostcache) {
- data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
+ data->hostcache = Curl_mk_dnscache();
if(!data->hostcache)
/* While we possibly could survive and do good without a host cache,
/* free name info */
void Curl_freeaddrinfo(Curl_addrinfo *freeaddr);
-/* free cached name info */
-void Curl_freednsinfo(void *freethis);
+/* make a new dns cache and return the handle */
+curl_hash *Curl_mk_dnscache(void);
/* prune old entries from the DNS cache */
void Curl_hostcache_prune(struct SessionHandle *data);
*availp |= CURLAUTH_DIGEST;
if(data->state.authwant == CURLAUTH_DIGEST) {
/* Digest authentication is activated */
- CURLdigest dig = CURLDIGEST_BAD;
-
- if(data->state.digest.nonce)
- infof(data, "Authentication problem. Ignoring this.\n");
- else
- dig = Curl_input_digest(conn, start);
+ CURLdigest dig = Curl_input_digest(conn, start);
if(CURLDIGEST_FINE == dig)
/* We act on it. Store our new url, which happens to be
the same one we already use! */
conn->newurl = strdup(data->change.url); /* clone string */
+ else
+ infof(data, "Authentication problem. Ignoring this.\n");
}
else
if(data->state.authwant & CURLAUTH_DIGEST) {
multi->type = CURL_MULTI_HANDLE;
}
- multi->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
+ multi->hostcache = Curl_mk_dnscache();
if(!multi->hostcache) {
/* failure, free mem and bail out */
free(multi);
{
case CURL_LOCK_DATA_DNS:
if (!share->hostcache) {
- share->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
+ share->hostcache = Curl_mk_dnscache();
}
break;