diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-06-13 09:30:45 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-07-04 08:35:09 +0200 |
commit | e6f8445edef8e7996d1cfb141d6df184efef972c (patch) | |
tree | 3b90f03794b92c243a3a09cebfa270d5502258e8 /include/curl/curl.h | |
parent | 193215db3ca956b1e5c99539bc20cf892870d11f (diff) | |
download | curl-e6f8445edef8e7996d1cfb141d6df184efef972c.tar.gz |
setopt: add CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR
... as replacements for deprecated CURLOPT_PROTOCOLS and
CURLOPT_REDIR_PROTOCOLS as these new ones do not risk running into the
32 bit limit the old ones are facing.
CURLINFO_PROTCOOL is now deprecated.
The curl tool is updated to use the new options.
Added test 1597 to verify the libcurl protocol parser.
Closes #8992
Diffstat (limited to 'include/curl/curl.h')
-rw-r--r-- | include/curl/curl.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h index 6527f2149..cf11dc2ec 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -1010,7 +1010,8 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy, #define CURLHSTS_ENABLE (long)(1<<0) #define CURLHSTS_READONLYFILE (long)(1<<1) -/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */ +/* 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) @@ -2144,6 +2145,15 @@ typedef enum { /* set the SSH host key callback custom pointer */ CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317), + /* specify which protocols that are allowed to be used for the transfer, + which thus helps the app which takes URLs from users or other external + inputs and want to restrict what protocol(s) to deal with. Defaults to + all built-in protocols. */ + CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318), + + /* specify which protocols that libcurl is allowed to follow directs to */ + CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319), + CURLOPT_LASTENTRY /* the last unused */ } CURLoption; |