CURLOPT: bump CURLPROXY_* enums to long, drop casts

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:

- CURLPROXY_HTTP
- CURLPROXY_HTTP_1_0
- CURLPROXY_HTTPS
- CURLPROXY_HTTPS2
- CURLPROXY_SOCKS4
- CURLPROXY_SOCKS4A
- CURLPROXY_SOCKS5
- CURLPROXY_SOCKS5_HOSTNAME

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18054
This commit is contained in:
Viktor Szakats
2025-07-28 10:59:48 +02:00
parent d45b85d791
commit 1a12663d06
10 changed files with 28 additions and 25 deletions

View File

@@ -788,20 +788,24 @@ typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
mbedtls_ssl_config */
void *userptr);
#define CURLPROXY_HTTP 0L /* added in 7.10, new in 7.19.4 default is
to use CONNECT HTTP/1.1 */
#define CURLPROXY_HTTP_1_0 1L /* force to use CONNECT HTTP/1.0
added in 7.19.4 */
#define CURLPROXY_HTTPS 2L /* HTTPS but stick to HTTP/1
added in 7.52.0 */
#define CURLPROXY_HTTPS2 3L /* HTTPS and attempt HTTP/2
added in 8.2.0 */
#define CURLPROXY_SOCKS4 4L /* support added in 7.15.2, enum existed
already in 7.10 */
#define CURLPROXY_SOCKS5 5L /* added in 7.10 */
#define CURLPROXY_SOCKS4A 6L /* added in 7.18.0 */
#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
the hostname rather than the IP
address. added in 7.18.0 */
typedef enum {
CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
CONNECT HTTP/1.1 */
CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
HTTP/1.0 */
CURLPROXY_HTTPS = 2, /* HTTPS but stick to HTTP/1 added in 7.52.0 */
CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.2.0 */
CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
in 7.10 */
CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
hostname rather than the IP address. added
in 7.18.0 */
CURLPROXY_LAST = 8 /* never use */
} curl_proxytype; /* this enum was added in 7.10 */
/*