diff options
author | dartraiden <wowemuh@gmail.com> | 2020-07-07 22:32:37 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2020-07-07 22:33:07 +0300 |
commit | c1e254b55d930cccbae653320442fb7669be7692 (patch) | |
tree | 44d5ec46130218ac0e2cc8147613ff618b686657 /libs/libcurl/src/http2.c | |
parent | 9a8de7bc1afb5f72ddb6967c8fc32209ae3a73dd (diff) |
libcurl: update to 7.71.1
Diffstat (limited to 'libs/libcurl/src/http2.c')
-rw-r--r-- | libs/libcurl/src/http2.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libs/libcurl/src/http2.c b/libs/libcurl/src/http2.c index 61990019e7..6cf651f0c0 100644 --- a/libs/libcurl/src/http2.c +++ b/libs/libcurl/src/http2.c @@ -469,6 +469,46 @@ static struct Curl_easy *duphandle(struct Curl_easy *data) return second; } +static int set_transfer_url(struct Curl_easy *data, + struct curl_pushheaders *hp) +{ + const char *v; + CURLU *u = curl_url(); + CURLUcode uc; + char *url; + + v = curl_pushheader_byname(hp, ":scheme"); + if(v) { + uc = curl_url_set(u, CURLUPART_SCHEME, v, 0); + if(uc) + return 1; + } + + v = curl_pushheader_byname(hp, ":authority"); + if(v) { + uc = curl_url_set(u, CURLUPART_HOST, v, 0); + if(uc) + return 2; + } + + v = curl_pushheader_byname(hp, ":path"); + if(v) { + uc = curl_url_set(u, CURLUPART_PATH, v, 0); + if(uc) + return 3; + } + + uc = curl_url_get(u, CURLUPART_URL, &url, 0); + if(uc) + return 4; + curl_url_cleanup(u); + + if(data->change.url_alloc) + free(data->change.url); + data->change.url_alloc = TRUE; + data->change.url = url; + return 0; +} static int push_promise(struct Curl_easy *data, struct connectdata *conn, @@ -505,6 +545,10 @@ static int push_promise(struct Curl_easy *data, goto fail; } + rv = set_transfer_url(newhandle, &heads); + if(rv) + goto fail; + Curl_set_in_callback(data, true); rv = data->multi->push_cb(data, newhandle, stream->push_headers_used, &heads, |