static CURLcode socket_connect_result(struct Curl_easy *data,
const char *ipaddress, int error)
{
- char buffer[STRERROR_LEN];
-
switch(error) {
case EINPROGRESS:
case EWOULDBLOCK:
default:
/* unknown error, fallthrough and try another address! */
- infof(data, "Immediate connect fail for %s: %s",
- ipaddress, Curl_strerror(error, buffer, sizeof(buffer)));
+#ifdef CURL_DISABLE_VERBOSE_STRINGS
+ (void)ipaddress;
+#else
+ {
+ char buffer[STRERROR_LEN];
+ infof(data, "Immediate connect fail for %s: %s",
+ ipaddress, Curl_strerror(error, buffer, sizeof(buffer)));
+ }
+#endif
data->state.os_errno = error;
/* connect failed */
return CURLE_COULDNT_CONNECT;
bool isconnected = FALSE;
CURLcode result = CURLE_COULDNT_CONNECT;
bool is_tcp;
- const char *ipmsg;
(void)data;
DEBUGASSERT(ctx->sock == CURL_SOCKET_BAD);
if(result)
goto out;
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
+ {
+ const char *ipmsg;
#ifdef ENABLE_IPV6
- if(ctx->addr.family == AF_INET6) {
- set_ipv6_v6only(ctx->sock, 0);
- ipmsg = " Trying [%s]:%d...";
+ if(ctx->addr.family == AF_INET6) {
+ set_ipv6_v6only(ctx->sock, 0);
+ ipmsg = " Trying [%s]:%d...";
+ }
+ else
+#endif
+ ipmsg = " Trying %s:%d...";
+ infof(data, ipmsg, ctx->r_ip, ctx->r_port);
}
- else
#endif
- ipmsg = " Trying %s:%d...";
- infof(data, ipmsg, ctx->r_ip, ctx->r_port);
#ifdef ENABLE_IPV6
is_tcp = (ctx->addr.family == AF_INET
}
return CURLE_FAILED_INIT;
}
-
static void freednsentry(void *freethis);
-/*
- * Return # of addresses in a Curl_addrinfo struct
- */
-static int num_addresses(const struct Curl_addrinfo *addr)
-{
- int i = 0;
- while(addr) {
- addr = addr->ai_next;
- i++;
- }
- return i;
-}
-
/*
* Curl_printable_address() stores a printable version of the 1st address
* given in the 'ai' argument. The result will be stored in the buf that is
}
#ifndef CURL_DISABLE_SHUFFLE_DNS
+/*
+ * Return # of addresses in a Curl_addrinfo struct
+ */
+static int num_addresses(const struct Curl_addrinfo *addr)
+{
+ int i = 0;
+ while(addr) {
+ addr = addr->ai_next;
+ i++;
+ }
+ return i;
+}
+
UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data,
struct Curl_addrinfo **addr);
/*
CURL_DNS_HASH_SIZE);
}
-#ifdef DEBUGBUILD
+#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
static void multi_warn_debug(struct Curl_multi *multi, struct Curl_easy *data)
{
if(!multi->warned) {
data->set.out = va_arg(param, void *);
break;
+#ifdef CURL_LIST_ONLY_PROTOCOL
case CURLOPT_DIRLISTONLY:
/*
* An option that changes the command to one that asks for a list only, no
*/
data->set.list_only = (0 != va_arg(param, long)) ? TRUE : FALSE;
break;
-
+#endif
case CURLOPT_APPEND:
/*
* We want to upload and append to an existing file. Used for FTP and
}
data->state.prefer_ascii = data->set.prefer_ascii;
+#ifdef CURL_LIST_ONLY_PROTOCOL
data->state.list_only = data->set.list_only;
+#endif
data->state.httpreq = data->set.method;
data->state.url = data->set.str[STRING_SET_URL];
#define PROTO_FAMILY_SMTP (CURLPROTO_SMTP|CURLPROTO_SMTPS)
#define PROTO_FAMILY_SSH (CURLPROTO_SCP|CURLPROTO_SFTP)
+#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH) || \
+ !defined(CURL_DISABLE_POP3)
+/* these protocols support CURLOPT_DIRLISTONLY */
+#define CURL_LIST_ONLY_PROTOCOL 1
+#endif
+
#define DEFAULT_CONNCACHE_SIZE 5
/* length of longest IPv6 address string including the trailing null */
struct curltime last_sndbuf_update; /* last time readwrite_upload called
win_update_buffer_size */
#endif
+#ifndef CURL_DISABLE_COOKIES
unsigned char setcookies;
+#endif
unsigned char writer_stack_depth; /* Unencoding stack depth. */
BIT(header); /* incoming data has HTTP header */
BIT(content_range); /* set TRUE if Content-Range: was found */
#ifndef CURL_DISABLE_SMB
struct smb_conn smbc;
#endif
+#ifdef USE_LIBRTMP
void *rtmp;
+#endif
+#ifdef USE_OPENLDAP
struct ldapconninfo *ldapc;
+#endif
#ifndef CURL_DISABLE_MQTT
struct mqtt_conn mqtt;
#endif
#ifdef USE_WEBSOCKETS
struct websocket *ws;
#endif
+ unsigned int unused:1; /* avoids empty union */
} proto;
struct connectbundle *bundle; /* The bundle we are member of */
when multi_done() is called, to prevent multi_done() to get
invoked twice when the multi interface is used. */
BIT(previouslypending); /* this transfer WAS in the multi->pending queue */
+#ifndef CURL_DISABLE_COOKIES
BIT(cookie_engine);
+#endif
BIT(prefer_ascii); /* ASCII rather than binary */
+#ifdef CURL_LIST_ONLY_PROTOCOL
BIT(list_only); /* list directory contents */
+#endif
BIT(url_alloc); /* URL string is malloc()'ed */
BIT(referer_alloc); /* referer string is malloc()ed */
BIT(wildcard_resolve); /* Set to true if any resolve change is a wildcard */
BIT(tftp_no_options); /* do not send TFTP options requests */
#endif
BIT(sep_headers); /* handle host and proxy headers separately */
+#ifndef CURL_DISABLE_COOKIES
BIT(cookiesession); /* new cookie session? */
+#endif
BIT(crlf); /* convert crlf on ftp upload(?) */
BIT(ssh_compression); /* enable SSH compression */
BIT(tunnel_thru_httpproxy); /* use CONNECT through an HTTP proxy */
BIT(prefer_ascii); /* ASCII rather than binary */
BIT(remote_append); /* append, not overwrite, on upload */
+#ifdef CURL_LIST_ONLY_PROTOCOL
BIT(list_only); /* list directory */
+#endif
#ifndef CURL_DISABLE_FTP
BIT(ftp_use_port); /* use the FTP PORT command */
BIT(ftp_use_epsv); /* if EPSV is to be attempted or not */
FILE *fp;
unsigned char *buf = NULL, *pem_ptr = NULL;
CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH;
+#ifdef CURL_DISABLE_VERBOSE_STRINGS
+ (void)data;
+#endif
/* if a path wasn't specified, don't pin */
if(!pinnedpubkey)