Repository navigation
feat(libcurl): implement curl_mime_data_cb - #18316
Merged
oneandonlydean merged 3 commits intoNov 12, 2026
Merged
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Contributor
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
alvaroelpob
marked this pull request as ready for review
November 11, 2026 17:06
12 tasks done
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements
curl_mime_data_cb, which threw throughNotImplemented_nid_no_patch.The part gets host read, seek and free callbacks that call the guest functions with the guest
arg, through a context shared by the part and the copiescurl_easy_duphandlemakes of it. In curl 7.81.0Curl_mime_duppart(mime.c) gives each copy the samereadfunc,seekfunc,freefuncandarg, so the guest free function runs once per copy, as it does here. To know when the last holder is gone, the adapter followscurl_mime_addpart,curl_mime_subparts,curl_mime_data,curl_mime_filedata,curl_mime_free,CURLOPT_MIMEPOST,curl_easy_duphandle,curl_easy_resetandcurl_easy_cleanup: the context lives while a part still holds it or a duplicate handle holds a copy, which matches when 7.81.0 frees part contents (cleanup_part_content, Curl_mime_set_subparts). A nullreadfuncstores nothing, as upstream.curl_easy_duphandleis the only caller ofCurl_mime_duppartin 7.81.0.The debt entry for the export is replaced by a MIME callbacks entry: whether the console also calls the free function once per copy is unverified.
Tested
Linux (WSL2, Ubuntu): full build and suite on fddd10b, 4863/4863 tests pass; check_conventions passes. The new guest_curl_mimecallback posts a callback part through a duplicated handle to a loopback HTTP server after the original mime is freed, and checks the guest free function runs once per copy, on content replacement and through owned subparts.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)