cURL / Mailing Lists / curl-library / Single Mail



From: Daniel Stenberg <>
Date: Wed, 20 Jun 2012 22:27:59 +0200 (CEST)

On Wed, 20 Jun 2012, Tom Bishop, Wenlin Institute wrote:

> No, I hadn't realized it returned anything! I started by imitating the
> example programs (such as <>),
> which don't check the return value for curl_easy_setopt(). I should have
> paid more attention to the disclaimer, "These files are intended as examples
> only. In the interest of simplicity and clarity, they might not include
> proper error handling..." They might serve as better examples by at least
> writing "res = curl_easy_setopt(...)" even if nothing is then done with res;
> that would serve as a reminder that "real-world applications" should check
> the return value. As it is, the examples treat curl_easy_setopt()
> differently from, for example, curl_easy_perform(), in a way that seems to
> suggest that only the latter returns a value.

Perhaps. I'm just concerned that the examples will get messier and less clear
if we'd make them "better" in that aspect and that's the reason they are like

Another alternative would be to better show that disclaimer in all examples,
either in the source code or just above the examples on the web site.

> It might still be worthwhile to add the warning I suggested.

But what makes this particular option stand out in comparison to others that
can be disabled? Should we add such an infof() for all options if tried when
explicitly disabled? I'm not convinced...

List admin:
Received on 2012-06-20