curl-library
Re: Simple cookie interface!
Date: Wed, 27 Jul 2005 02:10:08 +0300
Daniel Stenberg wrote:
> On Thu, 21 Jul 2005, Peteris Krumins [Newsgroups] wrote:
>
>> I have added simple cookie interface to libcurl as, according to
>> http://curl.haxx.se/mail/lib-2004-12/0195.html.
>
>
> Neat. Thanks for your work! I have some suggestions though:
>
> 1 - please follow the curl source code indent style
>
> 2 - use aprintf() in get_netscape_format() instead as it'll simplify
> the code
> a lot and make it less error-prone (aprintf() returns a malloc()ed
> string)
>
> 3 - provide some docs too
Okay, I'll change these.
>
>> If NULL is passed instead of a cookie, all cookies are erased.
>
>
> I'm not sure this is the most intuitive interface. The most common use
> for NULL as an argument to an option seem to be to reset an option or
> to not act as a non-NULL would. Making NULL clear all cookies seems
> drastic. I think I would prefer reservering a single magic string for
> that, like "ALL". Such a string could never be a valid input cookie
> anyway.
>
> Or am I wrong?
Yes, this is much nicer. I'll make a change.
P.Krumins
Received on 2005-07-27