Skip to content

Commit

Permalink
curl_formfree: clarify which pointer to free
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Jun 23, 2011
1 parent 42c6b75 commit 8da5da9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/libcurl/curl_formadd.3
Expand Up @@ -30,18 +30,19 @@ curl_formadd - add a section to a multipart/formdata HTTP POST
.ad .ad
.SH DESCRIPTION .SH DESCRIPTION
curl_formadd() is used to append sections when building a multipart/formdata curl_formadd() is used to append sections when building a multipart/formdata
HTTP POST (sometimes referred to as RFC2388-style posts). Append one section at HTTP POST (sometimes referred to as RFC2388-style posts). Append one section
a time until you've added all the sections you want included and then you pass at a time until you've added all the sections you want included and then you
the \fIfirstitem\fP pointer as parameter to \fBCURLOPT_HTTPPOST\fP. pass the \fIfirstitem\fP pointer as parameter to \fBCURLOPT_HTTPPOST\fP.
\fIlastitem\fP is set after each call and on repeated invokes it should be \fIlastitem\fP is set after each \fIcurl_formadd(3)\fP call and on repeated
left as set to allow repeated invokes to find the end of the list faster. invokes it should be left as set to allow repeated invokes to find the end of
the list faster.


After the \fIlastitem\fP pointer follow the real arguments. After the \fIlastitem\fP pointer follow the real arguments.


The pointers \fI*firstitem\fP and \fI*lastitem\fP should both be pointing to The pointers \fIfirstitem\fP and \fIlastitem\fP should both be pointing to
NULL in the first call to this function. All list-data will be allocated by NULL in the first call to this function. All list-data will be allocated by
the function itself. You must call \fIcurl_formfree(3)\fP after the form post the function itself. You must call \fIcurl_formfree(3)\fP on the
has been done to free the resources. \fIfirstitem\P after the form post has been done to free the resources.


Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual. You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
Expand Down
4 changes: 4 additions & 0 deletions docs/libcurl/curl_formfree.3
Expand Up @@ -32,6 +32,10 @@ curl_formfree() is used to clean up data previously built/appended with
\fIcurl_formadd(3)\fP. This must be called when the data has been used, which \fIcurl_formadd(3)\fP. This must be called when the data has been used, which
typically means after \fIcurl_easy_perform(3)\fP has been called. typically means after \fIcurl_easy_perform(3)\fP has been called.


The pointer to free is the same pointer you passed to the
\fBCURLOPT_HTTPPOST\fP option, which is the \fIfirstitem\fP pointer from the
\fIcurl_formadd(3)\fP invoke(s).

\fBform\fP is the pointer as returned from a previous call to \fBform\fP is the pointer as returned from a previous call to
\fIcurl_formadd(3)\fP and may be NULL. \fIcurl_formadd(3)\fP and may be NULL.
.SH RETURN VALUE .SH RETURN VALUE
Expand Down

0 comments on commit 8da5da9

Please sign in to comment.