cURL / Mailing Lists / curl-users / Single Mail


Re: wishlist: curl_easy_setopt(3): add better bad input warning?

From: Daniel Stenberg <>
Date: Mon, 3 Mar 2008 23:17:01 +0100 (CET)

On Mon, 3 Mar 2008, Andreas Mohr wrote:

Since this is libcurl talk i CC my response to the more suitable curl-library
list. The full mail I reply to can be read here:

> doing something as simple as
> VERIFY(curl_easy_setopt(curl_handle, CURLOPT_VERBOSE) == CURLE_OK)
> can have dire consequences since it is missing the additional parameter
> (boolean, verbosity on/off) that seems to be required for all
> curl_easy_setopt() invocations. This results in loud complaints by Valgrind
> (stack trashing etc.).

Funny that you should bring this up right now, with Michal Marek's work on a
typechecker macro in progress:

> Read this manual carefully as bad input values may cause libcurl to behave
> badly!

[your suggestion]
> Read this manual carefully as _bad/missing/superfluous_ input values _to
> this variable argument count function may cause your entire program_ to
> behave badly!

Actually, I see how your version details this warning a lot more but in
general I don't think it'll make much of a difference. If the first version
doesn't make the user aware, will the second one really make the difference?

I'm just thinking that this particular man page is larger than most small
planets already and I want to keep things accurate but brief. Or am I just
being silly?

> Thanks a lot for a _very_ useful library! (soooo much more stable and
> powerful than widely used alternatives, it's not even funny! Helped me
> tremendously in getting net transfers just right)

You're welcome! I'm glad you find libcurl that good.

  Commercial curl and libcurl Technical Support:
Received on 2008-03-03