summaryrefslogtreecommitdiff
path: root/lib/easy.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/easy.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/easy.c')
-rw-r--r--lib/easy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/easy.c b/lib/easy.c
index b61ea7b7c..d7f93be1e 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -828,7 +828,7 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src)
/* Copy src->set into dst->set first, then deal with the strings
afterwards */
dst->set = src->set;
- Curl_mime_initpart(&dst->set.mimepost, dst);
+ Curl_mime_initpart(&dst->set.mimepost);
/* clear all string pointers first */
memset(dst->set.str, 0, STRING_LAST * sizeof(char *));
@@ -862,7 +862,7 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src)
}
/* Duplicate mime data. */
- result = Curl_mime_duppart(&dst->set.mimepost, &src->set.mimepost);
+ result = Curl_mime_duppart(dst, &dst->set.mimepost, &src->set.mimepost);
if(src->set.resolve)
dst->state.resolve = dst->set.resolve;