AC_MSG_RESULT(yes)
)
+dnl ************************************************************
+dnl disable bindlocal
+dnl
+AC_MSG_CHECKING([whether to support binding connections locally])
+AC_ARG_ENABLE(bindlocal,
+AS_HELP_STRING([--enable-bindlocal],[Enable local binding support])
+AS_HELP_STRING([--disable-bindlocal],[Disable local binding support]),
+[ case "$enableval" in
+ no)
+ AC_MSG_RESULT(no)
+ AC_DEFINE(CURL_DISABLE_BINDLOCAL, 1, [disable local binding support])
+ ;;
+ *) AC_MSG_RESULT(yes)
+ ;;
+ esac ],
+ AC_MSG_RESULT(yes)
+)
+
dnl ************************************************************
dnl disable form API support
dnl
Disable support for Alt-Svc: HTTP headers.
+## `CURL_DISABLE_BINDLOCAL`
+
+Disable support for binding the local end of connections.
+
## `CURL_DISABLE_COOKIES`
Disable support for HTTP cookies.
}
#endif
+#ifndef CURL_DISABLE_BINDLOCAL
static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
curl_socket_t sockfd, int af, unsigned int scope)
{
return CURLE_INTERFACE_FAILED;
}
+#endif
/*
* verifyconnect() returns TRUE if the connect really has happened.
}
}
+#ifndef CURL_DISABLE_BINDLOCAL
/* possibly bind the local end to an IP, interface or port */
if(ctx->addr.family == AF_INET
#ifdef ENABLE_IPV6
goto out;
}
}
+#endif
/* set socket non-blocking */
(void)curlx_nonblock(ctx->sock, TRUE);
}
#endif
+#ifndef CURL_DISABLE_BINDLOCAL
+
#if defined(HAVE_GETIFADDRS)
if2ip_result_t Curl_if2ip(int af,
}
#endif
+
+#endif /* CURL_DISABLE_BINDLOCAL */
result = Curl_setstropt(&data->set.str[STRING_DEVICE],
va_arg(param, char *));
break;
+#ifndef CURL_DISABLE_BINDLOCAL
case CURLOPT_LOCALPORT:
/*
* Set what local port to bind the socket to when performing an operation.
return CURLE_BAD_FUNCTION_ARGUMENT;
data->set.localportrange = curlx_sltous(arg);
break;
+#endif
case CURLOPT_GSSAPI_DELEGATION:
/*
* GSS-API credential delegation bitmask
if(!conn->localdev)
goto error;
}
+#ifndef CURL_DISABLE_BINDLOCAL
conn->localportrange = data->set.localportrange;
conn->localport = data->set.localport;
+#endif
/* the close socket stuff needs to be copied to the connection struct as
it may live on without (this specific) Curl_easy */
curl_off_t postfieldsize; /* if POST, this might have a size to use instead
of strlen(), and then the data *may* be binary
(contain zero bytes) */
+#ifndef CURL_DISABLE_BINDLOCAL
unsigned short localport; /* local port number to bind to */
unsigned short localportrange; /* number of additional port numbers to test
in case the 'localport' one can't be
bind()ed */
+#endif
curl_write_callback fwrite_func; /* function that stores the output */
curl_write_callback fwrite_header; /* function that stores headers */
curl_write_callback fwrite_rtp; /* function that stores interleaved RTP */
#include <stdio.h>
static const char *disabled[]={
+#ifdef CURL_DISABLE_BINDLOCAL
+ "bindlocal",
+#endif
#ifdef CURL_DISABLE_COOKIES
"cookies",
#endif