mirror of https://github.com/moparisthebest/curl
CURLINFO_COOKIELIST.3: Fix example
Prior to this change the example would try to import cookies from stdin, which wasn't what was intended. Reported-by: 3dyd@users.noreply.github.com Fixes https://github.com/curl/curl/issues/4930
This commit is contained in:
parent
b26c92fbf0
commit
03564deba2
|
@ -45,8 +45,8 @@ CURL *curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||||
|
|
||||||
/* enable the cookie engine with a non-existing file */
|
/* enable the cookie engine */
|
||||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "-");
|
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "");
|
||||||
|
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ if(curl) {
|
||||||
/* a linked list of cookies in cookie file format */
|
/* a linked list of cookies in cookie file format */
|
||||||
struct curl_slist *each = cookies;
|
struct curl_slist *each = cookies;
|
||||||
while(each) {
|
while(each) {
|
||||||
printf("%s", each->data);
|
printf("%s\\n", each->data);
|
||||||
each = each->next;
|
each = each->next;
|
||||||
}
|
}
|
||||||
/* we must free these cookies when we're done */
|
/* we must free these cookies when we're done */
|
||||||
|
|
Loading…
Reference in New Issue