setopt: use the handler table for protocol name to number conversions

This also returns error CURLE_UNSUPPORTED_PROTOCOL rather than
CURLE_BAD_FUNCTION_ARGUMENT when a listed protocol name is not found.

A new schemelen parameter is added to Curl_builtin_scheme() to support
this extended use.

Note that disabled protocols are not recognized anymore.

Tests adapted accordingly.

Closes #9472
This commit is contained in:
Patrick Monnerat 2022-09-15 13:30:09 +02:00 committed by Daniel Stenberg
parent 1bbffa0833
commit 9d51329047
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
8 changed files with 90 additions and 98 deletions

View file

@ -31,6 +31,11 @@ http
<name>
--libcurl for GET with various options
</name>
<features>
http
ftp
file
</features>
<setenv>
SSL_CERT_FILE=
</setenv>