mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
adjusted to the new dns cache function to hide more hostip internals
This commit is contained in:
parent
b8b8473b6d
commit
7ea837a18c
@ -271,7 +271,7 @@ CURLcode curl_easy_perform(CURL *curl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!data->hostcache) {
|
if (!data->hostcache) {
|
||||||
data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
|
data->hostcache = Curl_mk_dnscache();
|
||||||
|
|
||||||
if(!data->hostcache)
|
if(!data->hostcache)
|
||||||
/* While we possibly could survive and do good without a host cache,
|
/* While we possibly could survive and do good without a host cache,
|
||||||
|
@ -74,8 +74,8 @@ void Curl_scan_cache_used(void *user, void *ptr);
|
|||||||
/* free name info */
|
/* free name info */
|
||||||
void Curl_freeaddrinfo(Curl_addrinfo *freeaddr);
|
void Curl_freeaddrinfo(Curl_addrinfo *freeaddr);
|
||||||
|
|
||||||
/* free cached name info */
|
/* make a new dns cache and return the handle */
|
||||||
void Curl_freednsinfo(void *freethis);
|
curl_hash *Curl_mk_dnscache(void);
|
||||||
|
|
||||||
/* prune old entries from the DNS cache */
|
/* prune old entries from the DNS cache */
|
||||||
void Curl_hostcache_prune(struct SessionHandle *data);
|
void Curl_hostcache_prune(struct SessionHandle *data);
|
||||||
|
@ -398,17 +398,14 @@ CURLcode Curl_http_auth(struct connectdata *conn,
|
|||||||
*availp |= CURLAUTH_DIGEST;
|
*availp |= CURLAUTH_DIGEST;
|
||||||
if(data->state.authwant == CURLAUTH_DIGEST) {
|
if(data->state.authwant == CURLAUTH_DIGEST) {
|
||||||
/* Digest authentication is activated */
|
/* Digest authentication is activated */
|
||||||
CURLdigest dig = CURLDIGEST_BAD;
|
CURLdigest dig = Curl_input_digest(conn, start);
|
||||||
|
|
||||||
if(data->state.digest.nonce)
|
|
||||||
infof(data, "Authentication problem. Ignoring this.\n");
|
|
||||||
else
|
|
||||||
dig = Curl_input_digest(conn, start);
|
|
||||||
|
|
||||||
if(CURLDIGEST_FINE == dig)
|
if(CURLDIGEST_FINE == dig)
|
||||||
/* We act on it. Store our new url, which happens to be
|
/* We act on it. Store our new url, which happens to be
|
||||||
the same one we already use! */
|
the same one we already use! */
|
||||||
conn->newurl = strdup(data->change.url); /* clone string */
|
conn->newurl = strdup(data->change.url); /* clone string */
|
||||||
|
else
|
||||||
|
infof(data, "Authentication problem. Ignoring this.\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(data->state.authwant & CURLAUTH_DIGEST) {
|
if(data->state.authwant & CURLAUTH_DIGEST) {
|
||||||
|
@ -122,7 +122,7 @@ CURLM *curl_multi_init(void)
|
|||||||
multi->type = CURL_MULTI_HANDLE;
|
multi->type = CURL_MULTI_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
multi->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
|
multi->hostcache = Curl_mk_dnscache();
|
||||||
if(!multi->hostcache) {
|
if(!multi->hostcache) {
|
||||||
/* failure, free mem and bail out */
|
/* failure, free mem and bail out */
|
||||||
free(multi);
|
free(multi);
|
||||||
|
@ -73,7 +73,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
|||||||
{
|
{
|
||||||
case CURL_LOCK_DATA_DNS:
|
case CURL_LOCK_DATA_DNS:
|
||||||
if (!share->hostcache) {
|
if (!share->hostcache) {
|
||||||
share->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
|
share->hostcache = Curl_mk_dnscache();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user