mirror of
https://github.com/curl/curl.git
synced 2026-07-26 07:47:33 +03:00
hostip: cache negative name resolves
Hold them for half the normal lifetime. Helps when told to transfer N URLs in quick succession that all use the same non-resolving hostname. Done by storing a DNS entry with a NULL pointer for 'addr'. Previously an attempt was made in #12406 by Björn Stenberg that was ultimately never merged. Closes #18157
This commit is contained in:
parent
06c12cc08b
commit
df2b4ccc22
11 changed files with 155 additions and 19 deletions
|
|
@ -252,7 +252,7 @@ test2064 test2065 test2066 test2067 test2068 test2069 test2070 test2071 \
|
|||
test2072 test2073 test2074 test2075 test2076 test2077 test2078 test2079 \
|
||||
test2080 test2081 test2082 test2083 test2084 test2085 test2086 test2087 \
|
||||
test2088 test2089 \
|
||||
test2100 test2101 test2102 test2103 \
|
||||
test2100 test2101 test2102 test2103 test2104 \
|
||||
\
|
||||
test2200 test2201 test2202 test2203 test2204 test2205 \
|
||||
\
|
||||
|
|
|
|||
49
tests/data/test2104
Normal file
49
tests/data/test2104
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
DNS cache
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<dns>
|
||||
</dns>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
dns
|
||||
</server>
|
||||
<features>
|
||||
override-dns
|
||||
</features>
|
||||
<name>
|
||||
Get three URLs with bad host name - cache
|
||||
</name>
|
||||
<setenv>
|
||||
CURL_DNS_SERVER=127.0.0.1:%DNSPORT
|
||||
</setenv>
|
||||
<command>
|
||||
http://examplehost.example/%TESTNUMBER http://examplehost.example/%TESTNUMBER http://examplehost.example/%TESTNUMBER
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# curl: (6) Could not resolve host: examplehost.example
|
||||
<errorcode>
|
||||
6
|
||||
</errorcode>
|
||||
|
||||
# Ignore HTTPS requests here
|
||||
<dns host="examplehost.example QTYPE A">
|
||||
QNAME examplehost.example QTYPE A
|
||||
QNAME examplehost.example QTYPE AAAA
|
||||
</dns>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
@ -36,7 +36,7 @@ lib%TESTNUMBER
|
|||
resolver start callback
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
||||
http://failthis/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
||||
</command>
|
||||
</client>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue