ipfs: add options to disable

- CPPFLAGS: `-DCURL_DISABLE_IPFS`
- configure: `--disable-ipfs`
- cmake: `-DCURL_DISABLE_IPFS=ON`

Fixes #14824
Closes #14827
This commit is contained in:
Viktor Szakats 2024-09-08 12:26:45 +02:00
parent 8b42df3eb1
commit ce7d0d4137
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
12 changed files with 71 additions and 4 deletions

View file

@ -171,7 +171,9 @@ static const struct LongShort aliases[]= {
{"insecure", ARG_BOOL, 'k', C_INSECURE},
{"interface", ARG_STRG, ' ', C_INTERFACE},
{"ip-tos", ARG_STRG, ' ', C_IP_TOS},
#ifndef CURL_DISABLE_IPFS
{"ipfs-gateway", ARG_STRG, ' ', C_IPFS_GATEWAY},
#endif /* !CURL_DISABLE_IPFS */
{"ipv4", ARG_NONE, '4', C_IPV4},
{"ipv6", ARG_NONE, '6', C_IPV6},
{"json", ARG_STRG, ' ', C_JSON},
@ -1321,9 +1323,11 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
if(!err && (config->maxredirs < -1))
err = PARAM_BAD_NUMERIC;
break;
#ifndef CURL_DISABLE_IPFS
case C_IPFS_GATEWAY: /* --ipfs-gateway */
err = getstr(&config->ipfs_gateway, nextarg, DENY_BLANK);
break;
#endif /* !CURL_DISABLE_IPFS */
case C_PROXY_NTLM: /* --proxy-ntlm */
if(!feature_ntlm)
err = PARAM_LIBCURL_DOESNT_SUPPORT;