cURL / Mailing Lists / curl-library / Single Mail

curl-library

--engine option

From: Gisle Vanem <giva_at_bgnett.no>
Date: Tue, 7 Dec 2004 15:51:22 +0100

This curl option seemingy accepts any value. Shouldn't
"curl --engine unknown" cause an exit?

Seems the order of CURLOPT_x i main.c is just ignoring any
failf() in url.c. Shouldn't CURLOPT_VERBOSE be ahead of
CURLOPT_SSLENGINE?

Before I mess up, I suggest something like:

diff -u -r1.293 main.c
--- main.c 24 Nov 2004 19:34:25 -0000 1.293
+++ main.c 7 Dec 2004 14:48:30 -0000
@@ -3345,9 +3345,6 @@
         if(1 == config->tcp_nodelay)
           curl_easy_setopt(curl, CURLOPT_TCP_NODELAY, 1);

- curl_easy_setopt(curl, CURLOPT_SSLENGINE, config->engine);
- curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1);
-
         /* where to store */
         curl_easy_setopt(curl, CURLOPT_WRITEDATA, (FILE *)&outs);
         /* what call to write */
@@ -3525,6 +3522,16 @@
         }
         curl_easy_setopt(curl, CURLOPT_VERBOSE, config->conf&CONF_VERBOSE);

+ /* new in curl ?? */
+ if (config->engine)
+ res = curl_easy_setopt(curl, CURLOPT_SSLENGINE, config->engine);
+ else
+ res = 0;
+ curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1);
+
+ if (res != CURLE_OK)
+ goto show_error;
+
         /* new in curl 7.10 */
         curl_easy_setopt(curl, CURLOPT_ENCODING,
                          (config->encoding) ? "" : NULL);
@@ -3685,6 +3692,8 @@
           ourWriteEnv(curl);
 #endif

+show_error:
+
 #ifdef VMS
         if (!config->showerror) {
           vms_show = VMSSTS_HIDE;

---------

There are probably a lot more options that could fail, so how should this
be handeled in general?

BTW. it would be nice if "--engine ?" could list the available engines.

--gv
Received on 2004-12-07