diff --git a/docs/examples/cacertinmem.c b/docs/examples/cacertinmem.c index b660c0d878df7363812b00fd78e25c7d1e14228c..30a5153a84965af377ef1539683182a3248bc325 100644 --- a/docs/examples/cacertinmem.c +++ b/docs/examples/cacertinmem.c @@ -125,7 +125,7 @@ int main(void) rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction); rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout); 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_SSL_VERIFYPEER,1L); rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); diff --git a/docs/examples/ftpgetresp.c b/docs/examples/ftpgetresp.c index db96a3a13b2540b6b7333f7c4757f0dc255f0c8b..dcb296adf142ec94f52b02e3fa1d7a0e730a6525 100644 --- a/docs/examples/ftpgetresp.c +++ b/docs/examples/ftpgetresp.c @@ -58,7 +58,7 @@ int main(void) /* 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_WRITEHEADER, respfile); + curl_easy_setopt(curl, CURLOPT_HEADERDATA, respfile); res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) diff --git a/docs/examples/rtsp.c b/docs/examples/rtsp.c index 669780a9bc089c6701f621792ec95698f25ed22d..fed343dfd6db971cc0802093f302feaa2d5fb4e9 100644 --- a/docs/examples/rtsp.c +++ b/docs/examples/rtsp.c @@ -224,7 +224,7 @@ int main(int argc, char * const argv[]) if (curl != NULL) { my_curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); 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); /* request server options */ diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c index d944ab99d64153b9790d4122e4e1d387d2b3c423..63ea99391e3410abb29755aad436ba00e7e9502f 100644 --- a/docs/examples/sepheaders.c +++ b/docs/examples/sepheaders.c @@ -66,7 +66,7 @@ int main(void) } /* 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 */ curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, bodyfile); diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c index 74c58461a6dfefc51afa4763fce5bc33b2257621..aefb79f624221944e566282d05a73b63e45f5056 100644 --- a/docs/examples/simplessl.c +++ b/docs/examples/simplessl.c @@ -75,7 +75,7 @@ int main(void) if(curl) { /* what call to write: */ 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 */ { diff --git a/docs/examples/url2file.c b/docs/examples/url2file.c index 64d27c88f2e0b939922755e1d9c596d8d6eae47c..adf696c9a10bd31c9a5618f63fb79aed14d594ae 100644 --- a/docs/examples/url2file.c +++ b/docs/examples/url2file.c @@ -63,9 +63,8 @@ int main(int argc, char *argv[]) pagefile = fopen(pagefilename, "wb"); if (pagefile) { - /* write the page body to this file handle. CURLOPT_FILE is also known as - CURLOPT_WRITEDATA*/ - curl_easy_setopt(curl_handle, CURLOPT_FILE, pagefile); + /* write the page body to this file handle */ + curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, pagefile); /* get it! */ curl_easy_perform(curl_handle); diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c index 36c1c9064c0a0e3bb2bf4b57b7aa3996836d5194..dd56c6167e17a575d147c0b8876de0dc7de870d6 100644 --- a/docs/examples/usercertinmem.c +++ b/docs/examples/usercertinmem.c @@ -184,7 +184,7 @@ int main(void) rv = curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction); rv = curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout); 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"); /* both VERIFYPEER and VERIFYHOST are set to 0 in this case because there is diff --git a/docs/libcurl/libcurl-tutorial.3 b/docs/libcurl/libcurl-tutorial.3 index e862758acf89a36b683293369c39703fcf021ab9..018001d7edae5b0a5acce02d8f3e558cec5e66a5 100644 --- a/docs/libcurl/libcurl-tutorial.3 +++ b/docs/libcurl/libcurl-tutorial.3 @@ -1058,7 +1058,7 @@ to 1. 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 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 \fICURLOPT_HEADERFUNCTION(3)\fP. diff --git a/docs/libcurl/libcurl.m4 b/docs/libcurl/libcurl.m4 index d7d5a525915698320bd58cc55eb455be1bd439d2..a84077a5e04e567b7eb83e57794daf24e62bb9e7 100644 --- a/docs/libcurl/libcurl.m4 +++ b/docs/libcurl/libcurl.m4 @@ -153,7 +153,7 @@ int x; curl_easy_setopt(NULL,CURLOPT_URL,NULL); x=CURL_ERROR_SIZE; x=CURLOPT_WRITEFUNCTION; -x=CURLOPT_FILE; +x=CURLOPT_WRITEDATA; x=CURLOPT_ERRORBUFFER; x=CURLOPT_STDERR; x=CURLOPT_VERBOSE; diff --git a/lib/url.c b/lib/url.c index e09a11a43e8b09152f3def9a5e5779b93b6b89bc..27b376f9c44c1f90039b2f7360705a38a2ec8730 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1430,7 +1430,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, break; #endif - case CURLOPT_WRITEHEADER: + case CURLOPT_HEADERDATA: /* * 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 *); break; - case CURLOPT_FILE: + case CURLOPT_WRITEDATA: /* * FILE pointer to write to. Or possibly * used as argument to the write callback.