aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-03-25 01:59:52 +0000
committerYang Tse <yangsita@gmail.com>2007-03-25 01:59:52 +0000
commitd6eca8922960f2e3bf2cd07eef3eebbdb7ee265a (patch)
tree35b8830ca0274fa10389eede6674f8881594965c
parent2bd1d7e996e8c781f14af8d3e7d0ffbd4033d5f1 (diff)
fix compiler warning
-rw-r--r--lib/ftp.c11
-rw-r--r--lib/hostip4.c4
-rw-r--r--lib/url.c41
3 files changed, 40 insertions, 16 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 8c54f7274..d0c69f243 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -655,7 +655,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
static void state(struct connectdata *conn,
ftpstate state)
{
-#ifdef CURLDEBUG
+#if defined(CURLDEBUG) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
/* for debug purposes */
const char *names[]={
"STOP",
@@ -693,7 +693,7 @@ static void state(struct connectdata *conn,
};
#endif
struct ftp_conn *ftpc = &conn->proto.ftpc;
-#ifdef CURLDEBUG
+#if defined(CURLDEBUG) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
if(ftpc->state != state)
infof(conn->data, "FTP %p state change from %s to %s\n",
ftpc, names[ftpc->state], names[state]);
@@ -3244,9 +3244,16 @@ ftp_pasv_verbose(struct connectdata *conn,
char *newhost, /* ascii version */
int port)
{
+#ifdef CURL_DISABLE_VERBOSE_STRINGS
+ (void)conn;
+ (void)ai;
+ (void)newhost;
+ (void)port;
+#else
char buf[256];
Curl_printable_address(ai, buf, sizeof(buf));
infof(conn->data, "Connecting to %s (%s) port %d\n", newhost, buf, port);
+#endif
}
/*
diff --git a/lib/hostip4.c b/lib/hostip4.c
index d2cd81911..d092d2718 100644
--- a/lib/hostip4.c
+++ b/lib/hostip4.c
@@ -129,6 +129,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
in_addr_t in;
struct hostent *buf = NULL;
+#ifdef CURL_DISABLE_VERBOSE_STRINGS
+ (void)conn;
+#endif
+
(void)port; /* unused in IPv4 code */
*waitp = 0; /* don't wait, we act synchronously */
diff --git a/lib/url.c b/lib/url.c
index d11ebd3a0..04f1aa497 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -195,6 +195,10 @@ RETSIGTYPE alarmfunc(int sig)
#endif /* WIN32 */
#endif /* USE_ARES */
+#ifdef CURL_DISABLE_VERBOSE_STRINGS
+#define verboseconnect(x) do { } while (0)
+#endif
+
void Curl_safefree(void *ptr)
{
if(ptr)
@@ -2289,11 +2293,13 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
{
CURLcode result;
Curl_addrinfo *addr;
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
char *hostname = conn->bits.proxy?conn->proxy.name:conn->host.name;
infof(data, "About to connect() to %s%s port %d (#%d)\n",
conn->bits.proxy?"proxy ":"",
hostname, conn->port, conn->connectindex);
+#endif
/*************************************************************
* Connect to server/proxy
@@ -2335,12 +2341,14 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
/*
* verboseconnect() displays verbose information after a connect
*/
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
static void verboseconnect(struct connectdata *conn)
{
infof(conn->data, "Connected to %s (%s) port %d (#%d)\n",
conn->bits.proxy ? conn->proxy.dispname : conn->host.dispname,
conn->ip_addr_str, conn->port, conn->connectindex);
}
+#endif
int Curl_protocol_getsock(struct connectdata *conn,
curl_socket_t *socks,
@@ -2481,6 +2489,14 @@ static bool tld_check_name(struct SessionHandle *data,
size_t err_pos;
char *uc_name = NULL;
int rc;
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
+ char *tld_errmsg;
+#ifndef HAVE_TLD_STRERROR
+ char no_msg[] = "<no msg>";
+#endif
+#else
+ (void)data;
+#endif
/* Convert (and downcase) ACE-name back into locale's character set */
rc = idna_to_unicode_lzlz(ace_hostname, &uc_name, 0);
@@ -2488,24 +2504,21 @@ static bool tld_check_name(struct SessionHandle *data,
return (FALSE);
rc = tld_check_lz(uc_name, &err_pos, NULL);
- if (rc == TLD_INVALID)
- infof(data, "WARNING: %s; pos %u = `%c'/0x%02X\n",
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
+ if (rc != TLD_SUCCESS)
#ifdef HAVE_TLD_STRERROR
- tld_strerror((Tld_rc)rc),
+ tld_errmsg = tld_strerror((Tld_rc)rc);
#else
- "<no msg>",
+ tld_errmsg = no_msg;
#endif
- err_pos, uc_name[err_pos],
- uc_name[err_pos] & 255);
+ if (rc == TLD_INVALID)
+ infof(data, "WARNING: %s; pos %u = `%c'/0x%02X\n",
+ tld_errmsg, err_pos, uc_name[err_pos],
+ uc_name[err_pos] & 255);
else if (rc != TLD_SUCCESS)
- infof(data, "WARNING: TLD check for %s failed; %s\n",
- uc_name,
-#ifdef HAVE_TLD_STRERROR
- tld_strerror((Tld_rc)rc)
-#else
- "<no msg>"
-#endif
- );
+ infof(data, "WARNING: TLD check for %s failed; %s\n",
+ uc_name, tld_errmsg);
+#endif /* CURL_DISABLE_VERBOSE_STRINGS */
if (uc_name)
idn_free(uc_name);
return (bool)(rc == TLD_SUCCESS);