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
This commit is contained in:
Daniel Stenberg 2022-09-10 17:13:44 +02:00
parent 70c8ce5ad0
commit ce753e3c31
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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 }
};