cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: --engine option

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 7 Dec 2004 10:04:48 -0800

On Tue, Dec 07, 2004 at 05:34:14PM +0100, Peter Sylvester wrote:
> Some time ago I had suggested (probably) in a private message
>
> to replace the curl_easy_setopt in main.c by a macro that
> tests the return code and exits to some error place, etc,
> just in order to keep the code as unchanges as possible.
>
> The error codes from setting options are relatively new.
> A year ago, no error was ever returned.
> something like: (untested)
>
> #define curl_easy_setopt(curl, opt, parm) \
> do { if ((res = url_easy_setopt(curl, opt, parm))!= CURLE_OK) \
> goto show_error ;} while (0)

If something like that is added, the option setting will have to be more
intelligent. Right now, many options are set blindly to default values,
regardless of whether they were specified on the command line or not.
If the program errs out on the first setopt error, then curl would always
abort when it run with a libcurl that has been compiled without support
for HTTP, for example, since it sets some HTTP options regardless of
what kind of URL is specified on the command line.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2004-12-07