summaryrefslogtreecommitdiff
path: root/lib/formdata.c
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2022-11-16 17:40:11 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-11-28 09:09:54 +0100
commiteb559c8056916f1e71570ac058d599347bebc2b4 (patch)
treef0f897f8b605a39222afd8724f33bf299d400e19 /lib/formdata.c
parent383fb29da17df6fed2612cb95454103dadfe948f (diff)
downloadcurl-eb559c8056916f1e71570ac058d599347bebc2b4.tar.gz
mime: relax easy/mime structures binding
Deprecation and removal of codeset conversion support from the library have released the strict need for an early binding of mime structures to an easy handle (https://github.com/curl/curl/commit/2610142). This constraint currently forces to create the handle before the mime structure and the latter cannot be attached to another handle once created (see https://curl.se/mail/lib-2022-08/0027.html). This commit removes the handle pointers from the mime structures allowing more flexibility on their use. When an easy handle is duplicated, bound mime structures must however still be duplicated too as their components hold send-time dynamic information. Closes #9927
Diffstat (limited to 'lib/formdata.c')
-rw-r--r--lib/formdata.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 058e06f1f..b30e8deee 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -715,10 +715,10 @@ int curl_formget(struct curl_httppost *form, void *arg,
CURLcode result;
curl_mimepart toppart;
- Curl_mime_initpart(&toppart, NULL); /* default form is empty */
+ Curl_mime_initpart(&toppart); /* default form is empty */
result = Curl_getformdata(NULL, &toppart, form, NULL);
if(!result)
- result = Curl_mime_prepare_headers(&toppart, "multipart/form-data",
+ result = Curl_mime_prepare_headers(NULL, &toppart, "multipart/form-data",
NULL, MIMESTRATEGY_FORM);
while(!result) {