]> git.ipfire.org Git - thirdparty/curl.git/commit
cli tool: do not use disabled protocols
authorPatrick Monnerat <patrick@monnerat.net>
Thu, 15 Sep 2022 12:31:36 +0000 (14:31 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 16 Sep 2022 21:29:08 +0000 (23:29 +0200)
commitdd2a024323dccd6b813adc4ec7673ab8625f0904
tree6ccf6be761008a4b7a4f273c8312a564d663c5ce
parent9d51329047952ebfc2b944b7448b8f87f9e6ed51
cli tool: do not use disabled protocols

As they are now rejected by the library, take care of not passing
disabled protocol names to CURLOPT_PROTOCOLS_STR and
CURLOPT_REDIR_PROTOCOLS_STR.

Rather than using the CURLPROTO_* constants, dynamically assign protocol
numbers based on the order they are listed by curl_version_info().

New type proto_set_t implements prototype bit masks: it should therefore
be large enough to accomodate all library-enabled protocols. If not,
protocol numbers beyond the bit count of proto_set_t are recognized but
"inaccessible": when used, a warning is displayed and the value is
ignored. Should proto_set_t overflows, enabled protocols are reordered to
force those having a public CURLPROTO_* representation to be accessible.

Code has been added to subordinate RTMP?* protocols to the presence of
RTMP in the enabled protocol list, being returned by curl_version_info()
or not.
src/tool_cb_hdr.c
src/tool_getparam.c
src/tool_help.c
src/tool_libinfo.c
src/tool_libinfo.h
src/tool_operate.c
src/tool_paramhlp.c
src/tool_paramhlp.h
src/tool_setopt.c
src/tool_setopt.h