http2: improved upload eos handling

- replace the counting of upload lengths with the new eos send flag
- improve frequency of stream draining to happen less on events where it
  is not needed
- this PR is based on #14220

http2, cf-h2-proxy: fix EAGAINed out buffer
- in adjust pollset and shutdown handling, a non-empty `ctx->outbufq`
  must trigger send polling, irregardless of http/2 flow control
- in http2, fix retry handling of blocked GOAWAY frame

test case improvement:
- let client 'upload-pausing' handle http versions

Closes #14253
This commit is contained in:
Stefan Eissing 2024-08-04 09:51:26 +02:00 committed by Daniel Stenberg
parent 344ba8c883
commit 35bf766280
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 302 additions and 190 deletions

View file

@ -475,9 +475,14 @@ class TestUpload:
client = LocalClient(name='upload-pausing', env=env, timeout=60)
if not client.exists():
pytest.skip(f'example client not built: {client.name}')
url = f'http://{env.domain1}:{env.http_port}/curltest/echo?id=[0-0]&die_after=0'
r = client.run([url])
r.check_exit_code(18) # PARTIAL_FILE
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]&die_after=0'
r = client.run(['-V', proto, url])
exp_code = 18 # PARTIAL_FILE
if proto == 'h2':
exp_code = 92 # CURLE_HTTP2_STREAM
elif proto == 'h3':
exp_code = 95 # CURLE_HTTP3
r.check_exit_code(exp_code)
# upload data, pause, let connection die without any response at all
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
@ -489,9 +494,12 @@ class TestUpload:
client = LocalClient(name='upload-pausing', env=env, timeout=60)
if not client.exists():
pytest.skip(f'example client not built: {client.name}')
url = f'http://{env.domain1}:{env.http_port}/curltest/echo?id=[0-0]&just_die=1'
r = client.run([url])
r.check_exit_code(52) # GOT_NOTHING
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]&just_die=1'
r = client.run(['-V', proto, url])
exp_code = 52 # GOT_NOTHING
if proto == 'h2' or proto == 'h3':
exp_code = 0 # we get a 500 from the server
r.check_exit_code(exp_code) # GOT_NOTHING
# upload data, pause, let connection die after 100 continue
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
@ -503,9 +511,12 @@ class TestUpload:
client = LocalClient(name='upload-pausing', env=env, timeout=60)
if not client.exists():
pytest.skip(f'example client not built: {client.name}')
url = f'http://{env.domain1}:{env.http_port}/curltest/echo?id=[0-0]&die_after_100=1'
r = client.run([url])
r.check_exit_code(52) # GOT_NOTHING
url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]&die_after_100=1'
r = client.run(['-V', proto, url])
exp_code = 52 # GOT_NOTHING
if proto == 'h2' or proto == 'h3':
exp_code = 0 # we get a 500 from the server
r.check_exit_code(exp_code) # GOT_NOTHING
# speed limited on put handler
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])