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 */
}

View file

@ -274,7 +274,7 @@ static const struct testcase get_parts_list[] ={
{"https://user@example.net",
"https | user | [12] | [13] | example.net | [15] | / | [16] | [17]",
0, 0, CURLUE_OK},
#ifdef USE_WEBSOCKETS
#ifndef CURL_DISABLE_WEBSOCKETS
{"ws://example.com/color/?green",
"ws | [11] | [12] | [13] | example.com | [15] | /color/ | green |"
" [17]",

View file

@ -24,7 +24,7 @@
#include "test.h"
#ifdef USE_WEBSOCKETS
#ifndef CURL_DISABLE_WEBSOCKETS
#if 0
static CURLcode send_ping(CURL *curl, const char *send_payload)

View file

@ -24,7 +24,7 @@
#include "test.h"
#ifdef USE_WEBSOCKETS
#ifndef CURL_DISABLE_WEBSOCKETS
struct ws_data {
CURL *easy;

View file

@ -24,7 +24,7 @@
#include "test.h"
#ifdef USE_WEBSOCKETS
#ifndef CURL_DISABLE_WEBSOCKETS
static CURLcode send_ping(CURL *curl, const char *send_payload)
{

View file

@ -26,7 +26,7 @@
#include "testtrace.h"
#include "memdebug.h"
#ifdef USE_WEBSOCKETS
#ifndef CURL_DISABLE_WEBSOCKETS
/* just close the connection */
static void websocket_close(CURL *curl)