protcol.h: fix the CURLPROTO_MASK

It had an 'f' too few. Also provide CURLPROTO_WS* unconditionally
internally, so that code can depend on them in all builds.

Follow-up to cd5ca80f00

Spotted by Codex Security

Test case 3219 added to catch this next time.

Closes #21031
This commit is contained in:
Daniel Stenberg 2026-03-20 13:55:47 +01:00
parent 07c10f09a5
commit f2ba8f0613
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 68 additions and 11 deletions

View file

@ -57,7 +57,6 @@ struct easy_pollset;
#define PORT_MQTT 1883
#define PORT_MQTTS 8883
#ifndef CURL_DISABLE_WEBSOCKETS
/* CURLPROTO_GOPHERS (29) is the highest publicly used protocol bit number,
* the rest are internal information. If we use higher bits we only do this on
* platforms that have a >= 64-bit type and then we use such a type for the
@ -65,11 +64,6 @@ struct easy_pollset;
*/
#define CURLPROTO_WS (1L << 30)
#define CURLPROTO_WSS ((curl_prot_t)1 << 31)
#else
#define CURLPROTO_WS 0L
#define CURLPROTO_WSS 0L
#endif
#define CURLPROTO_MQTTS (1LL << 32)
#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
@ -83,7 +77,7 @@ typedef curl_off_t curl_prot_t;
/* This mask is for all the old protocols that are provided and defined in the
public header and shall exclude protocols added since which are not exposed
in the API */
#define CURLPROTO_MASK 0x3ffffff
#define CURLPROTO_MASK 0x3fffffff
/* Convenience defines for checking protocols or their SSL based version. Each
protocol scheme should only ever have a single CURLPROTO_ in its protocol