add note about windows and dlls with CURLOPT_WRITEDATA

This commit is contained in:
Daniel Stenberg 2007-07-06 20:14:03 +00:00
parent 836ffbfc22
commit e2bac4fe6f
1 changed files with 7 additions and 5 deletions

View File

@ -1,8 +1,8 @@
/***************************************************************************** /*****************************************************************************
* _ _ ____ _ * _ _ ____ _
* Project ___| | | | _ \| | * Project ___| | | | _ \| |
* / __| | | | |_) | | * / __| | | | |_) | |
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* $Id$ * $Id$
@ -34,7 +34,7 @@ int main(int argc, char **argv)
CURLcode res; CURLcode res;
FILE *ftpfile; FILE *ftpfile;
FILE *respfile; FILE *respfile;
/* local file name to store the file as */ /* local file name to store the file as */
ftpfile = fopen("ftp-list", "wb"); /* b is binary, needed on win32 */ ftpfile = fopen("ftp-list", "wb"); /* b is binary, needed on win32 */
@ -46,6 +46,8 @@ int main(int argc, char **argv)
/* Get a file listing from sunet */ /* Get a file listing from sunet */
curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/"); curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/");
curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile); curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile);
/* If you intend to use this on windows with a libcurl DLL, you must use
CURLOPT_WRITEFUNCTION as well */
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_response); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_response);
curl_easy_setopt(curl, CURLOPT_WRITEHEADER, respfile); curl_easy_setopt(curl, CURLOPT_WRITEHEADER, respfile);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);