CURLcode curl_easy_setopt(CURL *handle, CURLOPT_WRITEFUNCTION, write_callback);
.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
received that needs to be saved. \fIptr\fP points to the delivered data, and
The received data will not be zero terminated!
-Return the number of bytes actually taken care of. If that amount differs from
-the amount passed to your callback function, it'll signal an error condition
-to the library. This will cause the transfer to get aborted and return
-\fICURLE_WRITE_ERROR\fP.
+Your callback should return the number of bytes actually taken care of. If
+that amount differs from the amount passed to your callback function, it'll
+signal an error condition to the library. This will cause the transfer to get
+aborted and the libcurl function used will return \fICURLE_WRITE_ERROR\fP.
-The callback function can return CURL_WRITEFUNC_PAUSE which then will cause
-writing to this connection to become paused. See \fIcurl_easy_pause(3)\fP for
-further details.
+If your callback function returns CURL_WRITEFUNC_PAUSE it will cause this
+transfer to become paused. See \fIcurl_easy_pause(3)\fP for further details.
This function may be called with zero bytes data if the transferred file is
empty.
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
-thousands. The maximum amount of body data that can be passed to the write
-callback is defined in the curl.h header file: CURL_MAX_WRITE_SIZE (the usual
-default is 16K). If you however have \fICURLOPT_HEADER(3)\fP set, which sends
-header data to the write callback, you can get up to
+thousands. The maximum amount of body data that will be passed to the write
+callback is defined in the curl.h header file: \fICURL_MAX_WRITE_SIZE\fP (the
+usual default is 16K). If you however have \fICURLOPT_HEADER(3)\fP set, which
+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
means 100K.
.SH DEFAULT