http2: support HTTP/2 to forward proxies, non-tunneling

- with `--proxy-http2` allow h2 ALPN negotiation to
  forward proxies
- applies to http: requests against a https: proxy only,
  as https: requests will auto-tunnel
- adding a HTTP/1 request parser in http1.c
- removed h2h3.c
- using new request parser in nghttp2 and all h3 backends
- adding test 2603 for request parser
- adding h2 proxy test cases to test_10_*

scorecard.py: request scoring accidentally always run curl
with '-v'. Removed that, expect double numbers.

labeller: added http1.* and h2-proxy sources to detection

Closes #10967
This commit is contained in:
Stefan Eissing 2023-04-14 11:38:14 +02:00 committed by Daniel Stenberg
parent fb1d62ff07
commit fc2f1e547a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
28 changed files with 1522 additions and 824 deletions

View file

@ -112,7 +112,6 @@ UNITTEST_START
Curl_dyn_init(&dbuf, 32*1024);
fail_if(Curl_dynhds_h1_dprint(&hds, &dbuf), "h1 print failed");
if(Curl_dyn_ptr(&dbuf)) {
fprintf(stderr, "%s", Curl_dyn_ptr(&dbuf));
fail_if(strcmp(Curl_dyn_ptr(&dbuf),
"test1: 123\r\ntest1: 123\r\nBla-Bla: thingies\r\n"),
"h1 format differs");
@ -121,5 +120,29 @@ UNITTEST_START
}
Curl_dynhds_free(&hds);
Curl_dynhds_init(&hds, 128, 4*1024);
/* continuation without previous header fails */
result = Curl_dynhds_h1_cadd_line(&hds, " indented value");
fail_unless(result, "add should have failed");
/* continuation with previous header must succeed */
fail_if(Curl_dynhds_h1_cadd_line(&hds, "ti1: val1"), "add");
fail_if(Curl_dynhds_h1_cadd_line(&hds, " val2"), "add indent");
fail_if(Curl_dynhds_h1_cadd_line(&hds, "ti2: val1"), "add");
fail_if(Curl_dynhds_h1_cadd_line(&hds, "\tval2"), "add indent");
fail_if(Curl_dynhds_h1_cadd_line(&hds, "ti3: val1"), "add");
fail_if(Curl_dynhds_h1_cadd_line(&hds, " val2"), "add indent");
Curl_dyn_init(&dbuf, 32*1024);
fail_if(Curl_dynhds_h1_dprint(&hds, &dbuf), "h1 print failed");
if(Curl_dyn_ptr(&dbuf)) {
fprintf(stderr, "indent concat: %s\n", Curl_dyn_ptr(&dbuf));
fail_if(strcmp(Curl_dyn_ptr(&dbuf),
"ti1: val1 val2\r\nti2: val1 val2\r\nti3: val1 val2\r\n"),
"wrong format");
}
Curl_dyn_free(&dbuf);
Curl_dynhds_free(&hds);
UNITTEST_STOP