From ac0222d35561fe952b5f26c26bac891f89a618c9 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 1 Aug 2025 17:35:42 +0200 Subject: [PATCH] CURLOPT: bump `CURLWS_NOAUTOPONG`, `CURLWS_RAW_MODE` macros to `long` This patch bumps the size of these macros from `int` to `long`, while keeping their actual values the same. It may cause incompatibilities in user code, requiring the bump of holder variables and/or adding casts: - CURLWS_NOAUTOPONG - CURLWS_RAW_MODE Also: - keep existing cast within the documentation to make sure it applies to older curl versions as well. Closes #18137 --- include/curl/websockets.h | 4 ++-- tests/libtest/lib2301.c | 2 +- tests/libtest/lib2700.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/curl/websockets.h b/include/curl/websockets.h index 1c4d5720e3..1337a3a090 100644 --- a/include/curl/websockets.h +++ b/include/curl/websockets.h @@ -73,8 +73,8 @@ CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer, unsigned int flags); /* bits for the CURLOPT_WS_OPTIONS bitmask: */ -#define CURLWS_RAW_MODE (1<<0) -#define CURLWS_NOAUTOPONG (1<<1) +#define CURLWS_RAW_MODE (1L<<0) +#define CURLWS_NOAUTOPONG (1L<<1) CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *curl); diff --git a/tests/libtest/lib2301.c b/tests/libtest/lib2301.c index d99f7dab06..cc6c00a1d4 100644 --- a/tests/libtest/lib2301.c +++ b/tests/libtest/lib2301.c @@ -84,7 +84,7 @@ static CURLcode test_lib2301(const char *URL) /* use the callback style */ curl_easy_setopt(curl, CURLOPT_USERAGENT, "webbie-sox/3"); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(curl, CURLOPT_WS_OPTIONS, (long)CURLWS_RAW_MODE); + curl_easy_setopt(curl, CURLOPT_WS_OPTIONS, CURLWS_RAW_MODE); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, t2301_write_cb); curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl); res = curl_easy_perform(curl); diff --git a/tests/libtest/lib2700.c b/tests/libtest/lib2700.c index d8dbbbb93a..f509089645 100644 --- a/tests/libtest/lib2700.c +++ b/tests/libtest/lib2700.c @@ -229,7 +229,7 @@ static CURLcode test_lib2700(const char *URL) easy_setopt(curl, CURLOPT_VERBOSE, 1L); easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); if(testnum != 2708) - easy_setopt(curl, CURLOPT_WS_OPTIONS, (long)CURLWS_NOAUTOPONG); + easy_setopt(curl, CURLOPT_WS_OPTIONS, CURLWS_NOAUTOPONG); res = curl_easy_perform(curl); if(res) { -- 2.47.3