WebSockets: make support official (non-experimental)

Inverts the configure/cmake options to instead provide options that
disable WebSockets and have them (ws + wss) enabled by default.

Closes #14936
This commit is contained in:
Daniel Stenberg 2024-09-27 13:19:55 +02:00
parent cfae354a9a
commit d78e129d50
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
26 changed files with 108 additions and 107 deletions

View file

@ -33,7 +33,7 @@
#include <stdlib.h>
#include <string.h>
#ifdef USE_WEBSOCKETS
#ifndef CURL_DISABLE_WEBSOCKETS
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
@ -210,7 +210,7 @@ out:
int main(int argc, char *argv[])
{
#ifdef USE_WEBSOCKETS
#ifndef CURL_DISABLE_WEBSOCKETS
CURL *curl;
CURLcode res = CURLE_OK;
const char *url;
@ -262,10 +262,10 @@ int main(int argc, char *argv[])
curl_global_cleanup();
return (int)res;
#else /* USE_WEBSOCKETS */
#else /* !CURL_DISABLE_WEBSOCKETS */
(void)argc;
(void)argv;
fprintf(stderr, "WebSockets not enabled in libcurl\n");
return 1;
#endif /* !USE_WEBSOCKETS */
#endif /* CURL_DISABLE_WEBSOCKETS */
}

View file

@ -42,7 +42,7 @@
#include <sys/time.h>
#endif
#ifdef USE_WEBSOCKETS
#ifndef CURL_DISABLE_WEBSOCKETS
static CURLcode ping(CURL *curl, const char *send_payload)
{
@ -124,7 +124,7 @@ static CURLcode pingpong(CURL *curl, const char *payload)
int main(int argc, char *argv[])
{
#ifdef USE_WEBSOCKETS
#ifndef CURL_DISABLE_WEBSOCKETS
CURL *curl;
CURLcode res = CURLE_OK;
const char *url, *payload;
@ -157,10 +157,10 @@ int main(int argc, char *argv[])
curl_global_cleanup();
return (int)res;
#else /* USE_WEBSOCKETS */
#else /* !CURL_DISABLE_WEBSOCKETS */
(void)argc;
(void)argv;
fprintf(stderr, "WebSockets not enabled in libcurl\n");
return 1;
#endif /* !USE_WEBSOCKETS */
#endif /* CURL_DISABLE_WEBSOCKETS */
}