mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:51:42 +03:00
CURLOPT: bump CURLPROTO_* 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: - CURLPROTO_HTTP - CURLPROTO_HTTPS - CURLPROTO_FTP - CURLPROTO_FTPS - CURLPROTO_SCP - CURLPROTO_SFTP - CURLPROTO_TELNET - CURLPROTO_LDAP - CURLPROTO_LDAPS - CURLPROTO_DICT - CURLPROTO_FILE - CURLPROTO_TFTP - CURLPROTO_IMAP - CURLPROTO_IMAPS - CURLPROTO_POP3 - CURLPROTO_POP3S - CURLPROTO_SMTP - CURLPROTO_SMTPS - CURLPROTO_RTSP - CURLPROTO_RTMP - CURLPROTO_RTMPT - CURLPROTO_RTMPE - CURLPROTO_RTMPTE - CURLPROTO_RTMPS - CURLPROTO_RTMPTS - CURLPROTO_GOPHER - CURLPROTO_SMB - CURLPROTO_SMBS - CURLPROTO_MQTT - CURLPROTO_GOPHERS - CURLPROTO_ALL Also: - keep existing cast within the documentation to make sure it applies to older curl versions as well. Closes #18136
This commit is contained in:
parent
ebbb8e3da7
commit
b131db5410
4 changed files with 37 additions and 37 deletions
|
|
@ -1072,37 +1072,37 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
|
|||
|
||||
/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
|
||||
options. Do not use. */
|
||||
#define CURLPROTO_HTTP (1<<0)
|
||||
#define CURLPROTO_HTTPS (1<<1)
|
||||
#define CURLPROTO_FTP (1<<2)
|
||||
#define CURLPROTO_FTPS (1<<3)
|
||||
#define CURLPROTO_SCP (1<<4)
|
||||
#define CURLPROTO_SFTP (1<<5)
|
||||
#define CURLPROTO_TELNET (1<<6)
|
||||
#define CURLPROTO_LDAP (1<<7)
|
||||
#define CURLPROTO_LDAPS (1<<8)
|
||||
#define CURLPROTO_DICT (1<<9)
|
||||
#define CURLPROTO_FILE (1<<10)
|
||||
#define CURLPROTO_TFTP (1<<11)
|
||||
#define CURLPROTO_IMAP (1<<12)
|
||||
#define CURLPROTO_IMAPS (1<<13)
|
||||
#define CURLPROTO_POP3 (1<<14)
|
||||
#define CURLPROTO_POP3S (1<<15)
|
||||
#define CURLPROTO_SMTP (1<<16)
|
||||
#define CURLPROTO_SMTPS (1<<17)
|
||||
#define CURLPROTO_RTSP (1<<18)
|
||||
#define CURLPROTO_RTMP (1<<19)
|
||||
#define CURLPROTO_RTMPT (1<<20)
|
||||
#define CURLPROTO_RTMPE (1<<21)
|
||||
#define CURLPROTO_RTMPTE (1<<22)
|
||||
#define CURLPROTO_RTMPS (1<<23)
|
||||
#define CURLPROTO_RTMPTS (1<<24)
|
||||
#define CURLPROTO_GOPHER (1<<25)
|
||||
#define CURLPROTO_SMB (1<<26)
|
||||
#define CURLPROTO_SMBS (1<<27)
|
||||
#define CURLPROTO_MQTT (1<<28)
|
||||
#define CURLPROTO_GOPHERS (1<<29)
|
||||
#define CURLPROTO_ALL (~0) /* enable everything */
|
||||
#define CURLPROTO_HTTP (1L<<0)
|
||||
#define CURLPROTO_HTTPS (1L<<1)
|
||||
#define CURLPROTO_FTP (1L<<2)
|
||||
#define CURLPROTO_FTPS (1L<<3)
|
||||
#define CURLPROTO_SCP (1L<<4)
|
||||
#define CURLPROTO_SFTP (1L<<5)
|
||||
#define CURLPROTO_TELNET (1L<<6)
|
||||
#define CURLPROTO_LDAP (1L<<7)
|
||||
#define CURLPROTO_LDAPS (1L<<8)
|
||||
#define CURLPROTO_DICT (1L<<9)
|
||||
#define CURLPROTO_FILE (1L<<10)
|
||||
#define CURLPROTO_TFTP (1L<<11)
|
||||
#define CURLPROTO_IMAP (1L<<12)
|
||||
#define CURLPROTO_IMAPS (1L<<13)
|
||||
#define CURLPROTO_POP3 (1L<<14)
|
||||
#define CURLPROTO_POP3S (1L<<15)
|
||||
#define CURLPROTO_SMTP (1L<<16)
|
||||
#define CURLPROTO_SMTPS (1L<<17)
|
||||
#define CURLPROTO_RTSP (1L<<18)
|
||||
#define CURLPROTO_RTMP (1L<<19)
|
||||
#define CURLPROTO_RTMPT (1L<<20)
|
||||
#define CURLPROTO_RTMPE (1L<<21)
|
||||
#define CURLPROTO_RTMPTE (1L<<22)
|
||||
#define CURLPROTO_RTMPS (1L<<23)
|
||||
#define CURLPROTO_RTMPTS (1L<<24)
|
||||
#define CURLPROTO_GOPHER (1L<<25)
|
||||
#define CURLPROTO_SMB (1L<<26)
|
||||
#define CURLPROTO_SMBS (1L<<27)
|
||||
#define CURLPROTO_MQTT (1L<<28)
|
||||
#define CURLPROTO_GOPHERS (1L<<29)
|
||||
#define CURLPROTO_ALL (~0L) /* enable everything */
|
||||
|
||||
/* long may be 32 or 64 bits, but we should never depend on anything else
|
||||
but 32 */
|
||||
|
|
|
|||
|
|
@ -348,10 +348,10 @@ static CURLcode doh_probe_run(struct Curl_easy *data,
|
|||
#endif
|
||||
#ifndef DEBUGBUILD
|
||||
/* enforce HTTPS if not debug */
|
||||
ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, (long)CURLPROTO_HTTPS);
|
||||
ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
|
||||
#else
|
||||
/* in debug mode, also allow http */
|
||||
ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, (long)CURLPROTO_HTTP|CURLPROTO_HTTPS);
|
||||
ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS);
|
||||
#endif
|
||||
ERROR_CHECK_SETOPT(CURLOPT_TIMEOUT_MS, (long)timeout_ms);
|
||||
ERROR_CHECK_SETOPT(CURLOPT_SHARE, (CURLSH *)data->share);
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ struct curl_trc_featt;
|
|||
* platforms that have a >= 64-bit type and then we use such a type for the
|
||||
* protocol fields in the protocol handler.
|
||||
*/
|
||||
#define CURLPROTO_WS (1<<30)
|
||||
#define CURLPROTO_WS (1L<<30)
|
||||
#define CURLPROTO_WSS ((curl_prot_t)1<<31)
|
||||
#else
|
||||
#define CURLPROTO_WS 0
|
||||
#define CURLPROTO_WSS 0
|
||||
#define CURLPROTO_WS 0L
|
||||
#define CURLPROTO_WSS 0L
|
||||
#endif
|
||||
|
||||
/* the default protocols accepting a redirect to */
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ static CURLcode test_lib1535(const char *URL)
|
|||
if(protocol != CURLPROTO_HTTP) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d protocol of http resource is incorrect; "
|
||||
"expected %d but is %ld\n",
|
||||
"expected %ld but is %ld\n",
|
||||
__FILE__, __LINE__, CURLPROTO_HTTP, protocol);
|
||||
res = CURLE_HTTP_RETURNED_ERROR;
|
||||
goto test_cleanup;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue