http2: initialize URL handle for server pushes
No binary (build failed)
—
(log yok)
| @@ -762,10 +762,13 @@ static int set_transfer_url(struct Curl_easy *newhandle, | |
| if(uc) | |
| rc = 4; | |
| fail: | |
| - | curl_url_cleanup(u); |
| - | if(rc) |
| + | if(rc) { |
| + | curl_url_cleanup(u); |
| return rc; | |
| + | } |
| + | DEBUGASSERT(!newhandle->state.uh); |
| + | newhandle->state.uh = u; |
| Curl_bufref_set(&newhandle->state.url, url, 0, curl_free); | |
| return 0; | |
| } | |
| @@ -49,6 +49,7 @@ class TestPush: | |
| ' H2PushResource /push/data2', | |
| '</Location>', | |
| '<Location /push/data2>', | |
| + | ' Header set Location "/push/data3"', |
| ' H2PushResource /push/data1', | |
| ' H2PushResource /push/data3', | |
| '</Location>', | |
| @@ -82,3 +83,5 @@ class TestPush: | |
| r.check_exit_code(0) | |
| assert os.path.exists(client.download_file(0)) | |
| assert os.path.exists(os.path.join(client.run_dir, 'push0')), r.dump_logs() | |
| + | redirect_url = f'https://localhost:{env.https_port}/push/data3' |
| + | assert f'**** push redirect URL: {redirect_url}' in r.stderr |
| @@ -169,6 +169,13 @@ static CURLcode test_cli_h2_serverpush(const char *URL) | |
| m = curl_multi_info_read(multi, &msgq); | |
| if(m && (m->msg == CURLMSG_DONE)) { | |
| CURL *easy = m->easy_handle; | |
| + | if(easy != curl) { |
| + | char *redirect_url = NULL; |
| + | if(!curl_easy_getinfo(easy, CURLINFO_REDIRECT_URL, |
| + | &redirect_url) && redirect_url) |
| + | curl_mfprintf(stderr, "**** push redirect URL: %s\n", |
| + | redirect_url); |
| + | } |
| transfers--; | |
| curl_multi_remove_handle(multi, easy); | |
| curl_easy_cleanup(easy); | |