From b676b66f4ddc68a0e357fc4cf79b9adb981c8df5 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sat, 11 Aug 2018 13:52:18 +0200 Subject: docs: Improve the manual pages of some callbacks - CURLOPT_HEADERFUNCTION: add newlines - CURLOPT_INTERLEAVEFUNCTION: fix the description of 'userdata' - CURLOPT_READDATA: mention crashes, same as in CURLOPT_WRITEDATA - CURLOPT_READFUNCTION: rename 'instream' to 'userdata' and explain how to set it Closes https://github.com/curl/curl/pull/2868 --- docs/libcurl/opts/CURLOPT_READFUNCTION.3 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'docs/libcurl/opts/CURLOPT_READFUNCTION.3') diff --git a/docs/libcurl/opts/CURLOPT_READFUNCTION.3 b/docs/libcurl/opts/CURLOPT_READFUNCTION.3 index 096312d28..0f2fb359d 100644 --- a/docs/libcurl/opts/CURLOPT_READFUNCTION.3 +++ b/docs/libcurl/opts/CURLOPT_READFUNCTION.3 @@ -26,7 +26,7 @@ CURLOPT_READFUNCTION \- read callback for data uploads .SH SYNOPSIS #include -size_t read_callback(char *buffer, size_t size, size_t nitems, void *instream); +size_t read_callback(char *buffer, size_t size, size_t nitems, void *userdata); CURLcode curl_easy_setopt(CURL *handle, CURLOPT_READFUNCTION, read_callback); @@ -39,9 +39,11 @@ the server. The data area pointed at by the pointer \fIbuffer\fP should be filled up with at most \fIsize\fP multiplied with \fInitems\fP number of bytes by your function. -Your function must then return the actual number of bytes that it stored in -that memory area. Returning 0 will signal end-of-file to the library and cause -it to stop the current transfer. +Set the \fIuserdata\fP argument with the \fICURLOPT_READDATA(3)\fP option. + +Your function must return the actual number of bytes that it stored in the data +area pointed at by the pointer \fIbuffer\fP. Returning 0 will signal +end-of-file to the library and cause it to stop the current transfer. If you stop the current transfer by returning 0 "pre-maturely" (i.e before the server expected it, like when you've said you will upload N bytes and you -- cgit v1.2.3