]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT: bump `CURLWS_NOAUTOPONG`, `CURLWS_RAW_MODE` macros to `long`
authorViktor Szakats <commit@vsz.me>
Fri, 1 Aug 2025 15:35:42 +0000 (17:35 +0200)
committerViktor Szakats <commit@vsz.me>
Fri, 1 Aug 2025 16:49:23 +0000 (18:49 +0200)
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
tests/libtest/lib2301.c
tests/libtest/lib2700.c

index 1c4d5720e3930725a1de91f7b99ae2803d5c091a..1337a3a090e9cb8cd923cddcdbc2c23ec3ae2710 100644 (file)
@@ -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);
 
index d99f7dab068ab5dacdb47344b3da61ad91acd2cb..cc6c00a1d43924cd3773ad38841e695094e92719 100644 (file)
@@ -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);
index d8dbbbb93a07cb193d4ccc3304a89ff2c2d6d540..f509089645435406b3748e99ec4826891292a00c 100644 (file)
@@ -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) {