Re: CURLOPT_COOKIEFILE with "-" as filename freezes program

2018-03-13 Thread Aron Bergman
2018-03-13 13:03 GMT+01:00 Daniel Stenberg :

> On Tue, 13 Mar 2018, Aron Bergman wrote:
>
> Oh, I just realized that I misunderstood this. COOKIELIST works as
>> intended, it just save the cookies, not read them (I mixed the meanings up),
>>
>
> CURLOPT_COOKIELIST let's you add cookies to the in-memory cookie jar. It
> also offers some "commands" to manipulate that cookie jar. Not sure what
> you mean with "save", but maybe we mean the same thing?
>
> You can read them as well, with the curl_easy_getinfo's corresponding
> CURLINFO_COOKIELIST option. Similar name, but that's for *reading* cookies.
>
> which is why the program "froze", it just awaited input from the command
>> line.
>>
>
> I don't understand how this option relates to any command line?
>
> I still think that the documentation should use "" as the argument value
>> or it should be stated that using "-" will require input (or CTRL + D).
>>
>
> "-" means libcurl will read from stdin instead of a file. It just seems it
> isn't mentioned in the CURLOPT_COOKIEFILE man page. I'll fix that right now.
>
> --
>
>  / daniel.haxx.se
> ---
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette:   https://curl.haxx.se/mail/etiquette.html


Yeah, I misunderstood the COOKIELIST option.

>  I'll fix that right now.
Great!

Regards
Aron Bergman
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Re: CURLOPT_COOKIEFILE with "-" as filename freezes program

2018-03-13 Thread Daniel Stenberg

On Tue, 13 Mar 2018, Aron Bergman wrote:

Oh, I just realized that I misunderstood this. COOKIELIST works as intended, 
it just save the cookies, not read them (I mixed the meanings up),


CURLOPT_COOKIELIST let's you add cookies to the in-memory cookie jar. It also 
offers some "commands" to manipulate that cookie jar. Not sure what you mean 
with "save", but maybe we mean the same thing?


You can read them as well, with the curl_easy_getinfo's corresponding 
CURLINFO_COOKIELIST option. Similar name, but that's for *reading* cookies.


which is why the program "froze", it just awaited input from the command 
line.


I don't understand how this option relates to any command line?

I still think that the documentation should use "" as the argument value or 
it should be stated that using "-" will require input (or CTRL + D).


"-" means libcurl will read from stdin instead of a file. It just seems it 
isn't mentioned in the CURLOPT_COOKIEFILE man page. I'll fix that right now.


--

 / daniel.haxx.se
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Re: CURLOPT_COOKIEFILE with "-" as filename freezes program

2018-03-13 Thread Aron Bergman
2018-03-13 9:51 GMT+01:00 Aron Bergman :

> I'm trying to fetch cookies from a website and print them to the console.
> To get started, I looked at the CURLINFO_COOKIELIST documentation
>  and used the
> example provided there.
> The example states that you can enable the cookie engine using a
> non-existing file and provides "-" as the filename argument on the line
> below. Trying to run the example code  only make my program hang.
> I then looked at the CURLOPT_COOKIEFILE documentation
>  to see if there
> were any clues to why this happened. The documentation states that:
> "Given an empty or non-existing file or by passing the empty string ("")
> to this option, you can enable the cookie engine without reading any
> initial cookies."
>
> Changed the argument from "-" to "" made the CURLINFO_COOKIELIST example
> code work.
> Are anyone having the same problem?
> I suspect that the reason that the COOKIELIST example uses "-" is because
> that would print to console using cURL on the commandline, but I don't know
> if "-" is supposed to be supported in libcurl.
>
> If the COOKIELIST example uses a unsupported argument I'll be happy to
> create a PR.
>
> Regards
>
> Aron Bergman
>
> bathing...@gmail.com
>

Oh, I just realized that I misunderstood this. COOKIELIST works as
intended, it just save the cookies, not read them (I mixed the meanings
up), which is why the program "froze", it just awaited input from the
command line.

I still think that the documentation should use "" as the argument value or
it should be stated that using "-" will require input (or CTRL + D).
Thoughts?

Regards
Aron Bergman
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

CURLOPT_COOKIEFILE with "-" as filename freezes program

2018-03-13 Thread Aron Bergman
I'm trying to fetch cookies from a website and print them to the console.
To get started, I looked at the CURLINFO_COOKIELIST documentation
 and used the
example provided there.
The example states that you can enable the cookie engine using a
non-existing file and provides "-" as the filename argument on the line
below. Trying to run the example code  only make my program hang.
I then looked at the CURLOPT_COOKIEFILE documentation
 to see if there
were any clues to why this happened. The documentation states that:
"Given an empty or non-existing file or by passing the empty string ("") to
this option, you can enable the cookie engine without reading any initial
cookies."

Changed the argument from "-" to "" made the CURLINFO_COOKIELIST example
code work.
Are anyone having the same problem?
I suspect that the reason that the COOKIELIST example uses "-" is because
that would print to console using cURL on the commandline, but I don't know
if "-" is supposed to be supported in libcurl.

If the COOKIELIST example uses a unsupported argument I'll be happy to
create a PR.

Regards

Aron Bergman

bathing...@gmail.com
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html