mirror of
https://github.com/curl/curl.git
synced 2026-08-24 14:43:31 +03:00
connect: limit update IP info
Update IP related information at the connection and the transfer in two places only: once the filter chain connects and when a transfer is added to a connection. The latter only updates on reuse when the filters already are connected. The only user of that information before a full connect is the HAProxy filter. Add cfilter CF_QUERY_IP_INFO query to let it find the information from the filters "below". This solves two issues with the previous version: - updates where often done twice with the same info - happy eyeballing filter "forks" could overwrite each others updates before the full winner was determined. Closes #14699
This commit is contained in:
parent
87f0a79439
commit
ea6f5c9f0f
15 changed files with 122 additions and 77 deletions
|
|
@ -94,7 +94,9 @@ class TestBasic:
|
|||
curl = CurlClient(env=env)
|
||||
url = f'https://{env.authority_for(env.domain1, proto)}/data.json'
|
||||
r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True)
|
||||
r.check_stats(http_status=200, count=1)
|
||||
r.check_stats(http_status=200, count=1,
|
||||
remote_port=env.port_for(alpn_proto=proto),
|
||||
remote_ip='127.0.0.1')
|
||||
assert r.stats[0]['time_connect'] > 0, f'{r.stats[0]}'
|
||||
assert r.stats[0]['time_appconnect'] > 0, f'{r.stats[0]}'
|
||||
|
||||
|
|
@ -108,7 +110,9 @@ class TestBasic:
|
|||
url = f'https://{env.authority_for(env.domain1, proto)}/data.json'
|
||||
r = curl.http_download(urls=[url], with_stats=True, with_headers=True,
|
||||
extra_args=['-I'])
|
||||
r.check_stats(http_status=200, count=1, exitcode=0)
|
||||
r.check_stats(http_status=200, count=1, exitcode=0,
|
||||
remote_port=env.port_for(alpn_proto=proto),
|
||||
remote_ip='127.0.0.1')
|
||||
# got the Conten-Length: header, but did not download anything
|
||||
assert r.responses[0]['header']['content-length'] == '30', f'{r.responses[0]}'
|
||||
assert r.stats[0]['size_download'] == 0, f'{r.stats[0]}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue