Mark the dns entry 'inuse' properly even when used from the cache. This
seems to correct some host cache screw-ups I could reproduce.
This commit is contained in:
12
lib/hostip.c
12
lib/hostip.c
@@ -367,8 +367,10 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
rc = 0;
|
rc = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
|
dns->inuse++; /* we use it! */
|
||||||
rc = 0;
|
rc = 0;
|
||||||
|
}
|
||||||
|
|
||||||
*entry = dns;
|
*entry = dns;
|
||||||
|
|
||||||
@@ -382,9 +384,15 @@ void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns)
|
|||||||
|
|
||||||
dns->inuse--;
|
dns->inuse--;
|
||||||
|
|
||||||
|
#ifdef CURLDEBUG
|
||||||
|
if(dns->inuse < 0) {
|
||||||
|
infof(data, "Interal host cache screw-up!");
|
||||||
|
*(char **)0=NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(data->share)
|
if(data->share)
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user