Update instances of some obsolete CURLOPTs to their new names

This commit is contained in:
Dan Fandrich 2014-07-05 16:59:12 +02:00
parent 8ffe6f5b57
commit 3ae2b6cd7f
10 changed files with 12 additions and 13 deletions

View File

@ -125,7 +125,7 @@ int main(void)
rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction); rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction);
rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout); rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout);
rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction); rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction);
rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr); rv=curl_easy_setopt(ch,CURLOPT_HEADERDATA, stderr);
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM"); rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L); rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");

View File

@ -58,7 +58,7 @@ int main(void)
/* If you intend to use this on windows with a libcurl DLL, you must use /* If you intend to use this on windows with a libcurl DLL, you must use
CURLOPT_WRITEFUNCTION as well */ 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_HEADERDATA, respfile);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
/* Check for errors */ /* Check for errors */
if(res != CURLE_OK) if(res != CURLE_OK)

View File

@ -224,7 +224,7 @@ int main(int argc, char * const argv[])
if (curl != NULL) { if (curl != NULL) {
my_curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); my_curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
my_curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); my_curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
my_curl_easy_setopt(curl, CURLOPT_WRITEHEADER, stdout); my_curl_easy_setopt(curl, CURLOPT_HEADERDATA, stdout);
my_curl_easy_setopt(curl, CURLOPT_URL, url); my_curl_easy_setopt(curl, CURLOPT_URL, url);
/* request server options */ /* request server options */

View File

@ -66,7 +66,7 @@ int main(void)
} }
/* we want the headers be written to this file handle */ /* we want the headers be written to this file handle */
curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, headerfile); curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, headerfile);
/* we want the body be written to this file handle instead of stdout */ /* we want the body be written to this file handle instead of stdout */
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, bodyfile); curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, bodyfile);

View File

@ -75,7 +75,7 @@ int main(void)
if(curl) { if(curl) {
/* what call to write: */ /* what call to write: */
curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://your.favourite.ssl.site"); curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://your.favourite.ssl.site");
curl_easy_setopt(curl, CURLOPT_WRITEHEADER, headerfile); curl_easy_setopt(curl, CURLOPT_HEADERDATA, headerfile);
for(i = 0; i < 1; i++) /* single-iteration loop, just to break out from */ for(i = 0; i < 1; i++) /* single-iteration loop, just to break out from */
{ {

View File

@ -63,9 +63,8 @@ int main(int argc, char *argv[])
pagefile = fopen(pagefilename, "wb"); pagefile = fopen(pagefilename, "wb");
if (pagefile) { if (pagefile) {
/* write the page body to this file handle. CURLOPT_FILE is also known as /* write the page body to this file handle */
CURLOPT_WRITEDATA*/ curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, pagefile);
curl_easy_setopt(curl_handle, CURLOPT_FILE, pagefile);
/* get it! */ /* get it! */
curl_easy_perform(curl_handle); curl_easy_perform(curl_handle);

View File

@ -184,7 +184,7 @@ int main(void)
rv = curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction); rv = curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction);
rv = curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout); rv = curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout);
rv = curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction); rv = curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction);
rv = curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr); rv = curl_easy_setopt(ch,CURLOPT_HEADERDATA, stderr);
rv = curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM"); rv = curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
/* both VERIFYPEER and VERIFYHOST are set to 0 in this case because there is /* both VERIFYPEER and VERIFYHOST are set to 0 in this case because there is

View File

@ -1058,7 +1058,7 @@ to 1.
What might be even more useful, is libcurl's ability to separate the headers What might be even more useful, is libcurl's ability to separate the headers
from the data and thus make the callbacks differ. You can for example set a from the data and thus make the callbacks differ. You can for example set a
different pointer to pass to the ordinary write callback by setting different pointer to pass to the ordinary write callback by setting
\fICURLOPT_WRITEHEADER(3)\fP. \fICURLOPT_HEADERDATA(3)\fP.
Or, you can set an entirely separate function to receive the headers, by using Or, you can set an entirely separate function to receive the headers, by using
\fICURLOPT_HEADERFUNCTION(3)\fP. \fICURLOPT_HEADERFUNCTION(3)\fP.

View File

@ -153,7 +153,7 @@ int x;
curl_easy_setopt(NULL,CURLOPT_URL,NULL); curl_easy_setopt(NULL,CURLOPT_URL,NULL);
x=CURL_ERROR_SIZE; x=CURL_ERROR_SIZE;
x=CURLOPT_WRITEFUNCTION; x=CURLOPT_WRITEFUNCTION;
x=CURLOPT_FILE; x=CURLOPT_WRITEDATA;
x=CURLOPT_ERRORBUFFER; x=CURLOPT_ERRORBUFFER;
x=CURLOPT_STDERR; x=CURLOPT_STDERR;
x=CURLOPT_VERBOSE; x=CURLOPT_VERBOSE;

View File

@ -1430,7 +1430,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
break; break;
#endif #endif
case CURLOPT_WRITEHEADER: case CURLOPT_HEADERDATA:
/* /*
* Custom pointer to pass the header write callback function * Custom pointer to pass the header write callback function
*/ */
@ -1443,7 +1443,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
*/ */
data->set.errorbuffer = va_arg(param, char *); data->set.errorbuffer = va_arg(param, char *);
break; break;
case CURLOPT_FILE: case CURLOPT_WRITEDATA:
/* /*
* FILE pointer to write to. Or possibly * FILE pointer to write to. Or possibly
* used as argument to the write callback. * used as argument to the write callback.