CURLOPT_WRITEFUNCTION.3: improved language
Suggestions-by: Jeff Pohlmeyer
This commit is contained in:
@@ -31,7 +31,8 @@ size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata);
|
|||||||
|
|
||||||
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_WRITEFUNCTION, write_callback);
|
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_WRITEFUNCTION, write_callback);
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Pass a pointer to your callback function, as the prototype shows above.
|
Pass a pointer to your callback function, which should match the prototype
|
||||||
|
shown above.
|
||||||
|
|
||||||
This callback function gets called by libcurl as soon as there is data
|
This callback function gets called by libcurl as soon as there is data
|
||||||
received that needs to be saved. \fIptr\fP points to the delivered data, and
|
received that needs to be saved. \fIptr\fP points to the delivered data, and
|
||||||
@@ -39,14 +40,13 @@ the size of that data is \fIsize\fP multiplied with \fInmemb\fP.
|
|||||||
|
|
||||||
The received data will not be zero terminated!
|
The received data will not be zero terminated!
|
||||||
|
|
||||||
Return the number of bytes actually taken care of. If that amount differs from
|
Your callback should return the number of bytes actually taken care of. If
|
||||||
the amount passed to your callback function, it'll signal an error condition
|
that amount differs from the amount passed to your callback function, it'll
|
||||||
to the library. This will cause the transfer to get aborted and return
|
signal an error condition to the library. This will cause the transfer to get
|
||||||
\fICURLE_WRITE_ERROR\fP.
|
aborted and the libcurl function used will return \fICURLE_WRITE_ERROR\fP.
|
||||||
|
|
||||||
The callback function can return CURL_WRITEFUNC_PAUSE which then will cause
|
If your callback function returns CURL_WRITEFUNC_PAUSE it will cause this
|
||||||
writing to this connection to become paused. See \fIcurl_easy_pause(3)\fP for
|
transfer to become paused. See \fIcurl_easy_pause(3)\fP for further details.
|
||||||
further details.
|
|
||||||
|
|
||||||
This function may be called with zero bytes data if the transferred file is
|
This function may be called with zero bytes data if the transferred file is
|
||||||
empty.
|
empty.
|
||||||
@@ -59,10 +59,10 @@ Set the \fIuserdata\fP argument with the \fICURLOPT_WRITEDATA(3)\fP option.
|
|||||||
|
|
||||||
The callback function will be passed as much data as possible in all invokes,
|
The callback function will be passed as much data as possible in all invokes,
|
||||||
but you cannot possibly make any assumptions. It may be one byte, it may be
|
but you cannot possibly make any assumptions. It may be one byte, it may be
|
||||||
thousands. The maximum amount of body data that can be passed to the write
|
thousands. The maximum amount of body data that will be passed to the write
|
||||||
callback is defined in the curl.h header file: CURL_MAX_WRITE_SIZE (the usual
|
callback is defined in the curl.h header file: \fICURL_MAX_WRITE_SIZE\fP (the
|
||||||
default is 16K). If you however have \fICURLOPT_HEADER(3)\fP set, which sends
|
usual default is 16K). If you however have \fICURLOPT_HEADER(3)\fP set, which
|
||||||
header data to the write callback, you can get up to
|
sends header data to the write callback, you can get up to
|
||||||
\fICURL_MAX_HTTP_HEADER\fP bytes of header data passed into it. This usually
|
\fICURL_MAX_HTTP_HEADER\fP bytes of header data passed into it. This usually
|
||||||
means 100K.
|
means 100K.
|
||||||
.SH DEFAULT
|
.SH DEFAULT
|
||||||
|
Reference in New Issue
Block a user