]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
setopt: make protocols2num() work with websockets
authorDaniel Stenberg <daniel@haxx.se>
Sat, 10 Sep 2022 15:13:44 +0000 (17:13 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 10 Sep 2022 21:11:47 +0000 (23:11 +0200)
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

lib/setopt.c

index afc44013c6acf72cf43503fe07d3b326c9681131..bfc7176437db3f475146e75dcb31b6944578fed3 100644 (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 }
   };