cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Daniel Stenberg <daniel_at_haxx.se>
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:
http://curl.haxx.se/mail/archive-2008-03/0008.html

> 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: http://curl.haxx.se/mail/lib-2008-02/0292.html

[current]
> 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: http://haxx.se/curl.html
Received on 2008-03-03