diff --git a/lib/easy.c b/lib/easy.c index d1e7ef4426fa9d3610ec47b2c79d591bf666e7de..bc91f4874fd9970a0703ed369fdb27a0bdadf3fd 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -271,7 +271,7 @@ CURLcode curl_easy_perform(CURL *curl) } 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, diff --git a/lib/hostip.h b/lib/hostip.h index 64d402240b23c20c39e4980becc60b5117f2e62a..b7d212d81c8b685f4f3362f20972d8dca6483a15 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -74,8 +74,8 @@ void Curl_scan_cache_used(void *user, void *ptr); /* 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); diff --git a/lib/http.c b/lib/http.c index a7961cba5bb3dde9539c88211e46b8c0d7fadd4f..41b1ef7c47ecc580b326a0b11071beaa3278ade1 100644 --- a/lib/http.c +++ b/lib/http.c @@ -398,17 +398,14 @@ CURLcode Curl_http_auth(struct connectdata *conn, *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) { diff --git a/lib/multi.c b/lib/multi.c index 18bfba2bde00565120d875560ff18d037efa2808..ddc4b16cba2d111c66b9024066e4990f7b690873 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -122,7 +122,7 @@ CURLM *curl_multi_init(void) 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); diff --git a/lib/share.c b/lib/share.c index ff1aef2e597c91dcca2d7737597064a3c0de55b7..e554339dec7afa8ceff082697b7d1ec8b073403a 100644 --- a/lib/share.c +++ b/lib/share.c @@ -73,7 +73,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) { case CURL_LOCK_DATA_DNS: if (!share->hostcache) { - share->hostcache = Curl_hash_alloc(7, Curl_freednsinfo); + share->hostcache = Curl_mk_dnscache(); } break;