mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Silent compiler warning.
This commit is contained in:
parent
0fcd1bb235
commit
196f70a7df
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
* http.c (gethttp): Fix memory leak.
|
* http.c (gethttp): Fix memory leak.
|
||||||
|
|
||||||
|
* ftp.c (getftp): Silent compiler warning.
|
||||||
|
|
||||||
2009-06-14 Phil Pennock <mutt-dev@spodhuis.org> (tiny change)
|
2009-06-14 Phil Pennock <mutt-dev@spodhuis.org> (tiny change)
|
||||||
* host.h: Declare `is_valid_ip_address'.
|
* host.h: Declare `is_valid_ip_address'.
|
||||||
* host.c (is_valid_ip_address): New function.
|
* host.c (is_valid_ip_address): New function.
|
||||||
|
35
src/ftp.c
35
src/ftp.c
@ -247,9 +247,8 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
|
|||||||
int csock, dtsock, local_sock, res;
|
int csock, dtsock, local_sock, res;
|
||||||
uerr_t err = RETROK; /* appease the compiler */
|
uerr_t err = RETROK; /* appease the compiler */
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *user, *passwd, *respline;
|
char *respline, *tms;
|
||||||
char *tms;
|
const char *user, *passwd, *tmrate;
|
||||||
const char *tmrate;
|
|
||||||
int cmd = con->cmd;
|
int cmd = con->cmd;
|
||||||
bool pasv_mode_open = false;
|
bool pasv_mode_open = false;
|
||||||
wgint expected_bytes = 0;
|
wgint expected_bytes = 0;
|
||||||
@ -289,13 +288,6 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
|
|||||||
{
|
{
|
||||||
char *host = con->proxy ? con->proxy->host : u->host;
|
char *host = con->proxy ? con->proxy->host : u->host;
|
||||||
int port = con->proxy ? con->proxy->port : u->port;
|
int port = con->proxy ? con->proxy->port : u->port;
|
||||||
char *logname = user;
|
|
||||||
|
|
||||||
if (con->proxy)
|
|
||||||
{
|
|
||||||
/* If proxy is in use, log in as username@target-site. */
|
|
||||||
logname = concat_strings (user, "@", u->host, (char *) 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Login to the server: */
|
/* Login to the server: */
|
||||||
|
|
||||||
@ -303,20 +295,10 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
|
|||||||
|
|
||||||
csock = connect_to_host (host, port);
|
csock = connect_to_host (host, port);
|
||||||
if (csock == E_HOST)
|
if (csock == E_HOST)
|
||||||
{
|
|
||||||
if (con->proxy)
|
|
||||||
xfree (logname);
|
|
||||||
|
|
||||||
return HOSTERR;
|
return HOSTERR;
|
||||||
}
|
|
||||||
else if (csock < 0)
|
else if (csock < 0)
|
||||||
{
|
|
||||||
if (con->proxy)
|
|
||||||
xfree (logname);
|
|
||||||
|
|
||||||
return (retryable_socket_connect_error (errno)
|
return (retryable_socket_connect_error (errno)
|
||||||
? CONERROR : CONIMPOSSIBLE);
|
? CONERROR : CONIMPOSSIBLE);
|
||||||
}
|
|
||||||
|
|
||||||
if (cmd & LEAVE_PENDING)
|
if (cmd & LEAVE_PENDING)
|
||||||
con->csock = csock;
|
con->csock = csock;
|
||||||
@ -328,10 +310,15 @@ getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
|
|||||||
quotearg_style (escape_quoting_style, user));
|
quotearg_style (escape_quoting_style, user));
|
||||||
if (opt.server_response)
|
if (opt.server_response)
|
||||||
logputs (LOG_ALWAYS, "\n");
|
logputs (LOG_ALWAYS, "\n");
|
||||||
err = ftp_login (csock, logname, passwd);
|
|
||||||
|
|
||||||
if (con->proxy)
|
if (con->proxy)
|
||||||
xfree (logname);
|
{
|
||||||
|
/* If proxy is in use, log in as username@target-site. */
|
||||||
|
char *logname = concat_strings (user, "@", u->host, (char *) 0);
|
||||||
|
err = ftp_login (csock, logname, passwd);
|
||||||
|
xfree (logname);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
err = ftp_login (csock, user, passwd);
|
||||||
|
|
||||||
/* FTPRERR, FTPSRVERR, WRITEFAILED, FTPLOGREFUSED, FTPLOGINC */
|
/* FTPRERR, FTPSRVERR, WRITEFAILED, FTPLOGREFUSED, FTPLOGINC */
|
||||||
switch (err)
|
switch (err)
|
||||||
@ -514,7 +501,7 @@ Error in server response, closing control connection.\n"));
|
|||||||
logputs (LOG_VERBOSE, _("==> CWD not needed.\n"));
|
logputs (LOG_VERBOSE, _("==> CWD not needed.\n"));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *targ = NULL;
|
const char *targ = NULL;
|
||||||
int cwd_count;
|
int cwd_count;
|
||||||
int cwd_end;
|
int cwd_end;
|
||||||
int cwd_start;
|
int cwd_start;
|
||||||
|
Loading…
Reference in New Issue
Block a user