luckily the man page for CURLOPT_POSTFIELDS already contains that info:

The data pointed to is NOT copied by the library: as a consequence, it
must  be  preserved
       by  the calling application until the associated transfer
finishes.  This behaviour can be
       changed (so libcurl does copy the data) by setting the
*CURLOPT_COPYPOSTFIELDS
<https://manpages.ubuntu.com/manpages/bionic/man3/CURLOPT_COPYPOSTFIELDS.3.html>(3)*
option.

/HH


Den tors 20 apr. 2023 kl 13:00 skrev Andreas Falkenhahn via curl-library <
curl-library@lists.haxx.se>:

> On 20.04.2023 at 12:31 Timothe Litt via curl-library wrote:
>
> > If there are any cases where the string is not copied and must be
> > retained, the documentation should say so explicitly.
>
> +1
>
> To make matters more confusing, I've also found this information:
>
> "There are currently over 80 options for curl_easy_setopt() that accept a
> string as its third argument. When a string is set in a handle, libcurl
> immediately copies that data so that the application does not have to keep
> the data around for the time the transfer is being done - with one notable
> exception: CURLOPT_POSTFIELDS."
>
> Found here: https://everything.curl.dev/libcurl/options/strings
>
> If that is true, maybe the note "The application does not have to keep the
> string around after setting this option" should be killed from all
> CURLOPT_*
> pages and there should only be a note for CURLOPT_POSTFIELDS that says that
> the string isn't copied.
>
> --
> Best regards,
>  Andreas Falkenhahn                            mailto:
> andr...@falkenhahn.com
>
> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
> Etiquette:   https://curl.se/mail/etiquette.html
>
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to