mirror of
https://github.com/curl/curl.git
synced 2026-08-24 18:43:32 +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 */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue