/
githubmirror
/
curl
Обзор
Документация
Войти
/
githubmirror
/
curl
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/data/test3225
69 строк
2 KB
Memduh Çelik
tests: pin connection reuse rules for partial, host, and credentials
30 июн 2026, 10:57
Не верифицирован
30 июн 2026, 10:57
ddc76c2
Код
Авторство
О чём код?
<?xml version="1.0" encoding="US-ASCII"?> <testcase> # url_match_destination() / Curl_peer_same_destination() require matching # origin hostname and port. Different Host names that resolve to the same # address must not share a connection. Both connections may stay in the # pool until process exit, so the server may see two DISCONNECT events only # at the end; num_connects proves a new connection was opened. <info> <keywords> HTTP HTTP GET --resolve connection reuse --next </keywords> </info> <reply> <data nocheck="yes"> HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 3 Content-Type: text/plain H1 </data> <data1 nocheck="yes"> HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 3 Content-Type: text/plain H2 </data1> <servercmd> connection-monitor </servercmd> </reply> <client> <server> http </server> <name> HTTP connection not reused when target host changes </name> <command> http://host-a.example.test:%HTTPPORT/%TESTNUMBER --resolve host-a.example.test:%HTTPPORT:%HOSTIP -o %LOGDIR/3225-1 -w "connects=%{num_connects}/" --next http://host-b.example.test:%HTTPPORT/%TESTNUMBER0001 --resolve host-b.example.test:%HTTPPORT:%HOSTIP -o %LOGDIR/3225-2 -w "connects=%{num_connects}/" </command> </client> <verify> <protocol crlf="headers"> GET /%TESTNUMBER HTTP/1.1 Host: host-a.example.test:%HTTPPORT User-Agent: curl/%VERSION Accept: */* GET /%TESTNUMBER0001 HTTP/1.1 Host: host-b.example.test:%HTTPPORT User-Agent: curl/%VERSION Accept: */* [DISCONNECT] [DISCONNECT] </protocol> # Same IP via --resolve, different Host names => new connection each time. <stdout nonewline="yes"> connects=1/connects=1/ </stdout> </verify> </testcase>