mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:03:39 +03:00
dnscache: own source file, improvements
- Rename `Curl_resolv_unlink()` to `Curl_dns_entry_unlink()`. - Change `Curl_dnscache_get()` to return CURLcode result. Returns now `CURLE_COULDNT_RESOLVE_HOST` for "negative" cache entries. - Add `Curl_dnscache_add_negative()` to put a "negative" entry into the cache. Closes #20864
This commit is contained in:
parent
b0f6e9a3d7
commit
96d5b5c688
35 changed files with 1648 additions and 1413 deletions
|
|
@ -641,8 +641,8 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
|
|||
* of the connection. The resolve functions should really be changed
|
||||
* to take a type parameter instead.
|
||||
*/
|
||||
int ip_version = (af == AF_INET) ?
|
||||
CURL_IPRESOLVE_V4 : CURL_IPRESOLVE_WHATEVER;
|
||||
uint8_t ip_version = (af == AF_INET) ?
|
||||
CURL_IPRESOLVE_V4 : CURL_IPRESOLVE_WHATEVER;
|
||||
#ifdef USE_IPV6
|
||||
if(af == AF_INET6)
|
||||
ip_version = CURL_IPRESOLVE_V6;
|
||||
|
|
@ -655,7 +655,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
|
|||
Curl_printable_address(h->addr, myhost, sizeof(myhost));
|
||||
infof(data, "Name '%s' family %i resolved to '%s' family %i",
|
||||
host, af, myhost, h_af);
|
||||
Curl_resolv_unlink(data, &h); /* this will NULL, potential free h */
|
||||
Curl_dns_entry_unlink(data, &h); /* this will NULL, potential free h */
|
||||
if(af != h_af) {
|
||||
/* bad IP version combo, signal the caller to try another address
|
||||
family if available */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue