mirror of
https://github.com/curl/curl.git
synced 2026-08-24 18:23:33 +03:00
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:
parent
cfae354a9a
commit
d78e129d50
26 changed files with 108 additions and 107 deletions
|
|
@ -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 */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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]",
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "test.h"
|
||||
|
||||
#ifdef USE_WEBSOCKETS
|
||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
|
||||
struct ws_data {
|
||||
CURL *easy;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "test.h"
|
||||
|
||||
#ifdef USE_WEBSOCKETS
|
||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
|
||||
static CURLcode send_ping(CURL *curl, const char *send_payload)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue