diff options
author | Stefan Eissing <stefan@eissing.org> | 2023-04-26 12:38:22 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2023-04-26 23:24:46 +0200 |
commit | acd82c8bfd743d0f743a1c1296890738832ac83e (patch) | |
tree | fc4da775326efd7562f6217f41929b703902431c /docs | |
parent | 21575b26fe33099e087b8beaac9bc43fa8597874 (diff) | |
download | curl-acd82c8bfd743d0f743a1c1296890738832ac83e.tar.gz |
tests/http: more tests with specific clients
- Makefile support for building test specific clients in tests/http/clients
- auto-make of clients when invoking pytest
- added test_09_02 for server PUSH_PROMISEs using clients/h2-serverpush
- added test_02_21 for lib based downloads and pausing/unpausing transfers
curl url parser:
- added internal method `curl_url_set_authority()` for setting the
authority part of a url (used for PUSH_PROMISE)
http2:
- made logging of PUSH_PROMISE handling nicer
Placing python test requirements in requirements.txt files
- separate files to base test suite and http tests since use
and module lists differ
- using the files in the gh workflows
websocket test cases, fixes for we and bufq
- bufq: account for spare chunks in space calculation
- bufq: reset chunks that are skipped empty
- ws: correctly encode frames with 126 bytes payload
- ws: update frame meta information on first call of collect
callback that fills user buffer
- test client ws-data: some test/reporting improvements
Closes #11006
Diffstat (limited to 'docs')
-rw-r--r-- | docs/examples/http2-serverpush.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index 31a34715d..7524c6289 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -130,7 +130,7 @@ int my_trace(CURL *handle, curl_infotype type, #define OUTPUTFILE "dl" -static int setup(CURL *hnd) +static int setup(CURL *hnd, const char *url) { FILE *out = fopen(OUTPUTFILE, "wb"); if(!out) @@ -141,7 +141,7 @@ static int setup(CURL *hnd) curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out); /* set the same URL */ - curl_easy_setopt(hnd, CURLOPT_URL, "https://localhost:8443/index.html"); + curl_easy_setopt(hnd, CURLOPT_URL, url); /* please be verbose */ curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); @@ -211,12 +211,16 @@ static int server_push_callback(CURL *parent, /* * Download a file over HTTP/2, take care of server push. */ -int main(void) +int main(int argc, char *argv[]) { CURL *easy; CURLM *multi_handle; int transfers = 1; /* we start with one */ struct CURLMsg *m; + const char *url = "https://localhost:8443/index.html"; + + if(argc == 2) + url = argv[1]; /* init a multi stack */ multi_handle = curl_multi_init(); @@ -224,7 +228,7 @@ int main(void) easy = curl_easy_init(); /* set options */ - if(setup(easy)) { + if(setup(easy, url)) { fprintf(stderr, "failed\n"); return 1; } |