diff options
author | Brad King <brad.king@kitware.com> | 2023-03-20 16:40:49 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-20 16:40:49 -0400 |
commit | e3dc4df9b95272037d27be25ae5ef030ffd83fa4 (patch) | |
tree | 6132bc02d5204bd988b32ee8ab06053ec7c0e4c4 /Utilities/cmcurl/lib/headers.c | |
parent | 4e6c3cd93bc870f44442e6d7e59896bc6d86ce25 (diff) | |
parent | e8bff971d9d835a65bcb1711e7214afe37b238e0 (diff) | |
download | cmake-e3dc4df9b95272037d27be25ae5ef030ffd83fa4.tar.gz |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2023-03-20 (b16d1fa8)
Diffstat (limited to 'Utilities/cmcurl/lib/headers.c')
-rw-r--r-- | Utilities/cmcurl/lib/headers.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Utilities/cmcurl/lib/headers.c b/Utilities/cmcurl/lib/headers.c index 22e0e01258..6cd7e31703 100644 --- a/Utilities/cmcurl/lib/headers.c +++ b/Utilities/cmcurl/lib/headers.c @@ -38,14 +38,13 @@ /* Generate the curl_header struct for the user. This function MUST assign all struct fields in the output struct. */ -static void copy_header_external(struct Curl_easy *data, - struct Curl_header_store *hs, +static void copy_header_external(struct Curl_header_store *hs, size_t index, size_t amount, struct Curl_llist_element *e, - struct curl_header **hout) + struct curl_header *hout) { - struct curl_header *h = *hout = &data->state.headerout; + struct curl_header *h = hout; h->name = hs->name; h->value = hs->value; h->amount = amount; @@ -118,7 +117,9 @@ CURLHcode curl_easy_header(CURL *easy, return CURLHE_MISSING; } /* this is the name we want */ - copy_header_external(data, hs, nameindex, amount, e_pick, hout); + copy_header_external(hs, nameindex, amount, e_pick, + &data->state.headerout[0]); + *hout = &data->state.headerout[0]; return CURLHE_OK; } @@ -132,7 +133,6 @@ struct curl_header *curl_easy_nextheader(CURL *easy, struct Curl_llist_element *pick; struct Curl_llist_element *e; struct Curl_header_store *hs; - struct curl_header *hout; size_t amount = 0; size_t index = 0; @@ -179,8 +179,9 @@ struct curl_header *curl_easy_nextheader(CURL *easy, index = amount - 1; } - copy_header_external(data, hs, index, amount, pick, &hout); - return hout; + copy_header_external(hs, index, amount, pick, + &data->state.headerout[1]); + return &data->state.headerout[1]; } static CURLcode namevalue(char *header, size_t hlen, unsigned int type, |