mark_as_advanced(CURL_DISABLE_PROGRESS_METER)
option(CURL_DISABLE_PROXY "Disable proxy support" OFF)
mark_as_advanced(CURL_DISABLE_PROXY)
+option(CURL_DISABLE_IPFS "Disable IPFS" OFF)
+mark_as_advanced(CURL_DISABLE_IPFS)
option(CURL_DISABLE_RTSP "Disable RTSP" OFF)
mark_as_advanced(CURL_DISABLE_SHA512_256)
option(CURL_DISABLE_SHA512_256 "Disable SHA-512/256 hash algorithm" OFF)
mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS)
if(CURL_DISABLE_HTTP)
+ set(CURL_DISABLE_IPFS ON)
set(CURL_DISABLE_RTSP ON)
set(CURL_DISABLE_ALTSVC ON)
set(CURL_DISABLE_HSTS ON)
set(CURL_DISABLE_LDAPS ON)
set(CURL_DISABLE_MQTT ON)
set(CURL_DISABLE_POP3 ON)
+ set(CURL_DISABLE_IPFS ON)
set(CURL_DISABLE_RTSP ON)
set(CURL_DISABLE_SMB ON)
set(CURL_DISABLE_SMTP ON)
# Clear list and try to detect available protocols
unset(_items)
_add_if("HTTP" NOT CURL_DISABLE_HTTP)
-_add_if("IPFS" NOT CURL_DISABLE_HTTP)
-_add_if("IPNS" NOT CURL_DISABLE_HTTP)
_add_if("HTTPS" NOT CURL_DISABLE_HTTP AND _ssl_enabled)
_add_if("FTP" NOT CURL_DISABLE_FTP)
_add_if("FTPS" NOT CURL_DISABLE_FTP AND _ssl_enabled)
_add_if("SMTPS" NOT CURL_DISABLE_SMTP AND _ssl_enabled)
_add_if("SCP" USE_LIBSSH2 OR USE_LIBSSH OR USE_WOLFSSH)
_add_if("SFTP" USE_LIBSSH2 OR USE_LIBSSH OR USE_WOLFSSH)
+_add_if("IPFS" NOT CURL_DISABLE_IPFS)
+_add_if("IPNS" NOT CURL_DISABLE_IPFS)
_add_if("RTSP" NOT CURL_DISABLE_RTSP)
_add_if("RTMP" USE_LIBRTMP)
_add_if("MQTT" NOT CURL_DISABLE_MQTT)
curl_sspi_msg="no (--enable-sspi)"
curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
curl_ldaps_msg="no (--enable-ldaps)"
+ curl_ipfs_msg="no (--enable-ipfs)"
curl_rtsp_msg="no (--enable-rtsp)"
curl_rtmp_msg="no (--with-librtmp)"
curl_psl_msg="no (--with-libpsl)"
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
disable_http="yes"
- AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
+ AC_MSG_WARN([disable HTTP disables FTP over proxy, IPFS and RTSP])
AC_SUBST(CURL_DISABLE_HTTP, [1])
+ AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS])
+ AC_SUBST(CURL_DISABLE_IPFS, [1])
AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
AC_SUBST(CURL_DISABLE_RTSP, [1])
dnl toggle off alt-svc too when HTTP is disabled
esac ],
AC_MSG_RESULT(yes)
)
+AC_MSG_CHECKING([whether to support IPFS])
+AC_ARG_ENABLE(ipfs,
+AS_HELP_STRING([--enable-ipfs],[Enable IPFS support])
+AS_HELP_STRING([--disable-ipfs],[Disable IPFS support]),
+[ case "$enableval" in
+ no)
+ AC_MSG_RESULT(no)
+ AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS])
+ AC_SUBST(CURL_DISABLE_IPFS, [1])
+ ;;
+ *)
+ if test x$CURL_DISABLE_HTTP = x1; then
+ AC_MSG_ERROR(HTTP support needs to be enabled in order to enable IPFS support!)
+ else
+ AC_MSG_RESULT(yes)
+ curl_ipfs_msg="enabled"
+ fi
+ ;;
+ esac ],
+ if test "x$CURL_DISABLE_HTTP" != "x1"; then
+ AC_MSG_RESULT(yes)
+ curl_ipfs_msg="enabled"
+ else
+ AC_MSG_RESULT(no)
+ fi
+)
AC_MSG_CHECKING([whether to support ldap])
AC_ARG_ENABLE(ldap,
AS_HELP_STRING([--enable-ldap],[Enable LDAP support])
dnl For supported protocols in pkg-config file
if test "x$CURL_DISABLE_HTTP" != "x1"; then
- SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP IPFS IPNS"
+ SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
fi
if test "x$USE_WOLFSSH" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
fi
+if test "x$CURL_DISABLE_IPFS" != "x1"; then
+ SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IPFS IPNS"
+fi
if test "x$CURL_DISABLE_RTSP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
fi
ca fallback: ${with_ca_fallback}
LDAP: ${curl_ldap_msg}
LDAPS: ${curl_ldaps_msg}
+ IPFS/IPNS: ${curl_ipfs_msg}
RTSP: ${curl_rtsp_msg}
RTMP: ${curl_rtmp_msg}
PSL: ${curl_psl_msg}
Disable support for proxies
+## `CURL_DISABLE_IPFS`
+
+Disable the IPFS/IPNS protocols. This affects the curl tool only, where
+IPFS/IPNS protocol support is implemented.
+
## `CURL_DISABLE_RTSP`
Disable the RTSP protocol.
/* disables proxies */
#cmakedefine CURL_DISABLE_PROXY 1
+/* disables IPFS from the curl tool */
+#cmakedefine CURL_DISABLE_IPFS 1
+
/* disables RTSP */
#cmakedefine CURL_DISABLE_RTSP 1
config->url_get = NULL;
config->url_out = NULL;
+#ifndef CURL_DISABLE_IPFS
Curl_safefree(config->ipfs_gateway);
+#endif /* !CURL_DISABLE_IPFS */
Curl_safefree(config->doh_url);
Curl_safefree(config->cipher_list);
Curl_safefree(config->proxy_cipher_list);
struct getout *url_get; /* point to the node to fill in URL */
struct getout *url_out; /* point to the node to fill in outfile */
struct getout *url_ul; /* point to the node to fill in upload */
+#ifndef CURL_DISABLE_IPFS
char *ipfs_gateway;
+#endif /* !CURL_DISABLE_IPFS */
char *doh_url;
char *cipher_list;
char *proxy_cipher_list;
{"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},
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;
printf("Release-Date: %s\n", LIBCURL_TIMESTAMP);
#endif
if(built_in_protos[0]) {
+#ifndef CURL_DISABLE_IPFS
const char *insert = NULL;
/* we have ipfs and ipns support if libcurl has http support */
for(builtin = built_in_protos; *builtin; ++builtin) {
insert = *builtin;
}
}
+#endif /* !CURL_DISABLE_IPFS */
printf("Protocols:");
for(builtin = built_in_protos; *builtin; ++builtin) {
/* Special case: do not list rtmp?* protocols.
They may only appear together with "rtmp" */
if(!curl_strnequal(*builtin, "rtmp", 4) || !builtin[0][4])
printf(" %s", *builtin);
+#ifndef CURL_DISABLE_IPFS
if(insert && insert == *builtin) {
printf(" ipfs ipns");
insert = NULL;
}
+#endif /* !CURL_DISABLE_IPFS */
}
puts(""); /* newline */
}
***************************************************************************/
#include "tool_setup.h"
+#ifndef CURL_DISABLE_IPFS
#include "curlx.h"
#include "dynbuf.h"
}
return result;
}
+#endif /* !CURL_DISABLE_IPFS */
***************************************************************************/
#include "tool_setup.h"
+#ifndef CURL_DISABLE_IPFS
#define MAX_GATEWAY_URL_LEN 10000
CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url,
struct OperationConfig *config);
#endif /* HEADER_CURL_TOOL_IPFS_H */
+#endif /* !CURL_DISABLE_IPFS */
const char *proto_scp = NULL;
const char *proto_sftp = NULL;
const char *proto_tftp = NULL;
+#ifndef CURL_DISABLE_IPFS
const char *proto_ipfs = "ipfs";
const char *proto_ipns = "ipns";
+#endif /* !CURL_DISABLE_IPFS */
static struct proto_name_tokenp {
const char *proto_name;
CURLU_GUESS_SCHEME | CURLU_NON_SUPPORT_SCHEME) &&
!curl_url_get(uh, CURLUPART_SCHEME, &schemep,
CURLU_DEFAULT_SCHEME)) {
+#ifdef CURL_DISABLE_IPFS
+ (void)config;
+#else
if(curl_strequal(schemep, proto_ipfs) ||
curl_strequal(schemep, proto_ipns)) {
result = ipfs_url_rewrite(uh, schemep, url, config);
config->synthetic_error = TRUE;
}
else
+#endif /* !CURL_DISABLE_IPFS */
proto = proto_token(schemep);
curl_free(schemep);