]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib: disable websockets early if no http
authorViktor Szakats <commit@vsz.me>
Thu, 5 Feb 2026 11:42:59 +0000 (12:42 +0100)
committerViktor Szakats <commit@vsz.me>
Thu, 5 Feb 2026 12:12:10 +0000 (13:12 +0100)
To prevent inconsistent `CURL_DISABLE_WEBSOCKETS` states between source
files.

Follow-up to 8edc0338f30f458f812f9ea355de1240771fa343 #20351

Closes #20526

lib/curl_setup.h
lib/ws.c

index 5c1e97aea6b4bd85923d382529c8e4b0b9ebfd44..4e49145f8407b224f9ef1c6002e2ecda44017a4d 100644 (file)
 #  define CURL_DISABLE_HEADERS_API 1
 #  define CURL_DISABLE_HSTS 1
 #  define CURL_DISABLE_HTTP_AUTH 1
+#  ifndef CURL_DISABLE_WEBSOCKETS
+#  define CURL_DISABLE_WEBSOCKETS /* no WebSockets without HTTP present */
+#  endif
 #endif
 
 /* ================================================================ */
index 3a4671b6fac5363b59c88c04beaa14d36ea02761..6ed417185e1d927ffaf85a51c0a5af3b413667fd 100644 (file)
--- a/lib/ws.c
+++ b/lib/ws.c
 #include "curl_setup.h"
 #include "urldata.h"
 
-#ifdef CURL_DISABLE_HTTP
-/* no WebSockets without HTTP present */
-#undef CURL_DISABLE_WEBSOCKETS
-#define CURL_DISABLE_WEBSOCKETS 1
-#endif
-
 #ifndef CURL_DISABLE_WEBSOCKETS
 
 #include "url.h"