cURL / Mailing Lists / curl-library / Single Mail


Re: Simple cookie interface!

From: Daniel Stenberg <>
Date: Wed, 27 Jul 2005 00:52:20 +0200 (CEST)

On Thu, 21 Jul 2005, Peteris Krumins [Newsgroups] wrote:

> I have added simple cookie interface to libcurl as, according to

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

> 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?

  Commercial curl and libcurl Technical Support:
Received on 2005-07-27