← Commit list

9315d9c4e4

Max Dymond
Max Dymond
2026-09-16
SUCCESS Duration: 417s

Subject

http2: initialize URL handle for server pushes

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/http2.c+5 -2
@@ -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;
}
tests/http/test_09_push.py+3 -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
tests/libtest/cli_h2_serverpush.c+7 -0
@@ -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);