From: Viktor Szakats Date: Mon, 2 Feb 2026 03:12:43 +0000 (+0100) Subject: ftp: drop single-caller local verbose function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66bb6413311f26861d47e4dc11eabb7611f679e2;p=thirdparty%2Fcurl.git ftp: drop single-caller local verbose function Closes #20495 --- diff --git a/lib/ftp.c b/lib/ftp.c index 767f2ae47d..c9a472ca15 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -85,28 +85,8 @@ #define LASTLINE(line) (STATUSCODE(line) && (' ' == line[3])) #ifndef CURLVERBOSE -#define ftp_pasv_verbose(a, b, c, d) Curl_nop_stmt #define FTP_CSTATE(c) ((void)(c), "") #else /* !CURLVERBOSE */ -/*************************************************************************** - * - * ftp_pasv_verbose() - * - * This function only outputs some informationals about this second connection - * when we have issued a PASV command before and thus we have connected to a - * possibly new IP address. - * - */ -static void ftp_pasv_verbose(struct Curl_easy *data, - struct Curl_addrinfo *ai, - char *newhost, /* ASCII version */ - int port) -{ - char buf[256]; - Curl_printable_address(ai, buf, sizeof(buf)); - infof(data, "Connecting to %s (%s) port %d", newhost, buf, port); -} - /* for tracing purposes */ static const char * const ftp_state_names[] = { "STOP", @@ -2101,9 +2081,16 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, * connect to connect. */ - if(data->set.verbose) - /* this just dumps information about this second connection */ - ftp_pasv_verbose(data, dns->addr, newhost, connectport); +#ifdef CURLVERBOSE + if(data->set.verbose) { + /* Dump information about this second connection when we have issued a PASV + * command before and thus we have connected to a possibly new IP address. + */ + char buf[256]; + Curl_printable_address(dns->addr, buf, sizeof(buf)); + infof(data, "Connecting to %s (%s) port %d", newhost, buf, connectport); + } +#endif curlx_free(conn->secondaryhostname); conn->secondary_port = newport;