"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "docs/libcurl/opts/CURLOPT_READFUNCTION.3" between
curl-7.65.3.tar.xz and curl-7.66.0.tar.xz

About: cURL is a powerful commandline tool to transfer data from or to a server, using one of the supported protocols HTTP(S), FTP(S), SCP, SFTP, TFTP, DICT, TELNET, LDAP(S) or FILE.

CURLOPT_READFUNCTION.3  (curl-7.65.3.tar.xz):CURLOPT_READFUNCTION.3  (curl-7.66.0.tar.xz)
skipping to change at line 50 skipping to change at line 50
If you set this callback pointer to NULL, or don't set it at all, the default internal read function If you set this callback pointer to NULL, or don't set it at all, the default internal read function
will be used. It is doing an fread() on the FILE * userdata set with CURL OPT_READDATA(3). will be used. It is doing an fread() on the FILE * userdata set with CURL OPT_READDATA(3).
DEFAULT DEFAULT
The default internal read callback is fread(). The default internal read callback is fread().
PROTOCOLS PROTOCOLS
This is used for all protocols when doing uploads. This is used for all protocols when doing uploads.
EXAMPLE EXAMPLE
Here's an example setting a read callback for reading that to size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userdata
upload to an FTP site: )
https://curl.haxx.se/libcurl/c/ftpupload.html {
FILE *readhere = (FILE *)userdata;
curl_off_t nread;
/* copy as much data as possible into the 'ptr' buffer, but no more tha
n
'size' * 'nmemb' bytes! */
size_t retcode = fread(ptr, size, nmemb, readhere);
nread = (curl_off_t)retcode;
fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T
" bytes from file\n", nread);
return retcode;
}
void setup(char *uploadthis)
{
FILE *file = fopen("rb", uploadthis);
CURLcode result;
/* set callback to use */
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
/* pass in suitable argument to callback */
curl_easy_setopt(curl, CURLOPT_READDATA, uploadthis);
result = curl_easy_perform(curl);
}
AVAILABILITY AVAILABILITY
CURL_READFUNC_PAUSE return code was added in 7.18.0 and CURL_READFUNC_ABO RT was added in 7.12.1. CURL_READFUNC_PAUSE return code was added in 7.18.0 and CURL_READFUNC_ABO RT was added in 7.12.1.
RETURN VALUE RETURN VALUE
This will return CURLE_OK. This will return CURLE_OK.
SEE ALSO SEE ALSO
CURLOPT_READDATA(3), CURLOPT_WRITEFUNCTION(3), CURLOPT_SEEKFUNCTION(3 ), CURLOPT_UPLOAD(3), CUR- CURLOPT_READDATA(3), CURLOPT_WRITEFUNCTION(3), CURLOPT_SEEKFUNCTION(3 ), CURLOPT_UPLOAD(3), CUR-
LOPT_POST(3), CURLOPT_UPLOAD_BUFFERSIZE(3), LOPT_POST(3), CURLOPT_UPLOAD_BUFFERSIZE(3),
libcurl 7.65.3 May 15, 2019 CURLOPT_READFUNCTION(3) libcurl 7.66.0 August 12, 2019 CURLOPT_READFUNCTION(3)
 End of changes. 2 change blocks. 
3 lines changed or deleted 31 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)