From: Daniel Stenberg Date: Sat, 10 Sep 2022 15:13:44 +0000 (+0200) Subject: setopt: make protocols2num() work with websockets X-Git-Tag: curl-7_86_0~264 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce753e3c3175d3d519ec8c346d9447b9cf719271;p=thirdparty%2Fcurl.git setopt: make protocols2num() work with websockets So that CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR can specify those as well. Reported-by: Patrick Monnerat Bug: https://curl.se/mail/lib-2022-09/0016.html Closes #9467 --- diff --git a/lib/setopt.c b/lib/setopt.c index afc44013c6..bfc7176437 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -185,6 +185,10 @@ static CURLcode protocol2num(char *str, curl_off_t *val) { "smtps", CURLPROTO_SMTPS }, { "telnet", CURLPROTO_TELNET }, { "tftp", CURLPROTO_TFTP }, +#ifdef USE_WEBSOCKETS + { "ws", CURLPROTO_WS }, + { "wss", CURLPROTO_WSS }, +#endif { NULL, 0 } };