Wallner's update
This commit is contained in:
@@ -9,20 +9,20 @@ curl_formget - serialize a previously build multipart/formdata HTTP POST chain
|
|||||||
.B #include <curl/curl.h>
|
.B #include <curl/curl.h>
|
||||||
.sp
|
.sp
|
||||||
.BI "void curl_formget(struct curl_httppost *" form, " void *" arg,
|
.BI "void curl_formget(struct curl_httppost *" form, " void *" arg,
|
||||||
.BI " curl_formget_callback " append);
|
.BI " curl_formget_callback " append ");"
|
||||||
.ad
|
.ad
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
curl_formget() is used to serialize data previously built/appended with
|
curl_formget() is used to serialize data previously built/appended with
|
||||||
\fIcurl_formadd(3)\fP. Accepts a void pointer as second argument which will be
|
\fIcurl_formadd(3)\fP. Accepts a void pointer as second argument which will be
|
||||||
passed to the curl_formget_callback function.
|
passed to the curl_formget_callback function.
|
||||||
|
|
||||||
.B "typedef size_t (*curl_formget_callback)(void *" arg, " const char *" buf,
|
.BI "typedef size_t (*curl_formget_callback)(void *" arg, " const char *" buf,
|
||||||
.B " size_t " len);
|
.BI " size_t " len ");"
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
The curl_formget_callback will be executed for each part of the httppost
|
The curl_formget_callback will be executed for each part of the HTTP POST
|
||||||
struct. The void *arg pointer will be the one passed as second argument to
|
chain. The void *arg pointer will be the one passed as second argument to
|
||||||
curl_formget(). The character buffer passed to it must not be freed. The
|
curl_formget(). The character buffer passed to it must not be freed. The
|
||||||
callback should return the buffer length passed to it on success.
|
callback should return the buffer length passed to it on success.
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
0 means everything was ok, non-zero means an error occurred
|
0 means everything was ok, non-zero means an error occurred
|
||||||
@@ -38,7 +38,7 @@ callback should return the buffer length passed to it on success.
|
|||||||
size_t print_httppost(struct curl_httppost *post)
|
size_t print_httppost(struct curl_httppost *post)
|
||||||
{
|
{
|
||||||
size_t total_size = 0;
|
size_t total_size = 0;
|
||||||
if(curl_formget(post, &total_size, out)) {
|
if(curl_formget(post, &total_size, print_httppost_callback)) {
|
||||||
return (size_t) -1;
|
return (size_t) -1;
|
||||||
}
|
}
|
||||||
return total_size;
|
return total_size;
|
||||||
|
Reference in New Issue
Block a user