[svn] New option --retry-connrefused from Ahmod Dancy.

This commit is contained in:
hniksic 2003-09-04 14:34:58 -07:00
parent 13d5d2ed73
commit 30ac043b0a
8 changed files with 32 additions and 4 deletions

8
NEWS
View File

@ -1,12 +1,14 @@
GNU Wget NEWS -- history of user-visible changes.
Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
See the end for copying conditions.
Please send GNU Wget bug reports to <bug-wget@gnu.org>.
* Changes in Wget 1.9.
** The build process now requires Autoconf 2.5x.
** It is now possible to specify that POST method be used for HTTP
requests. For example, `wget --post-data="id=foo&data=bar" URL' will
send a POST request with the specified contents.
@ -23,6 +25,10 @@ The ETA is still based on the average speed, though.
** It is now possible to connect to FTP servers through FWTK
firewalls. Set ftp_proxy to an FTP URL, and Wget will automatically
log on to the proxy as "username@host".
** The new option `--retry-connrefused' makes Wget retry downloads
even in the face of refused connections, which are otherwise
considered a fatal error.
* Wget 1.8.1 is a bugfix release with no user-visible changes.

View File

@ -1,3 +1,15 @@
2003-09-03 Ahmon Dancy <dancy@dancysoft.com>
* main.c init.c options.h: Added --retry-connrefused option so
that Connection Refused failures are treated as non-fatal (when
trying to retrieve from busy servers).
* wget.h: New CONNECT_ERROR macro for encapsulating this
modification.
* ftp.c http.c : Use CONNECT_ERROR macro in places where
ECONNREFUSED was checked.
2003-01-11 Ian Abbott <abbotti@mev.co.uk>
* ftp.c (ftp_retrieve_glob): Reject insecure filenames as determined

View File

@ -185,7 +185,7 @@ getftp (struct url *u, long *len, long restval, ccon *con)
address_list_release (al);
if (csock < 0)
return errno == ECONNREFUSED ? CONREFUSED : CONERROR;
return CONNECT_ERROR (errno);
if (cmd & LEAVE_PENDING)
rbuf_initialize (&con->rbuf, csock);
@ -578,7 +578,7 @@ Error in server response, closing control connection.\n"));
logprintf (LOG_VERBOSE, _("couldn't connect to %s:%hu: %s\n"),
pretty_print_address (&passive_addr), passive_port,
strerror (save_errno));
return save_errno == ECONNREFUSED ? CONREFUSED : CONERROR;
return CONNECT_ERROR (save_errno);
}
pasv_mode_open = 1; /* Flag to avoid accept port */

View File

@ -765,7 +765,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
address_list_release (al);
if (sock < 0)
return errno == ECONNREFUSED ? CONREFUSED : CONERROR;
return CONNECT_ERROR (errno);
#ifdef HAVE_SSL
if (conn->scheme == SCHEME_HTTPS)

View File

@ -188,6 +188,7 @@ static struct {
{ "relativeonly", &opt.relative_only, cmd_boolean },
{ "removelisting", &opt.remove_listing, cmd_boolean },
{ "retrsymlinks", &opt.retr_symlinks, cmd_boolean },
{ "retryconnrefused", &opt.retry_connrefused, cmd_boolean },
{ "robots", &opt.use_robots, cmd_boolean },
{ "savecookies", &opt.cookies_output, cmd_file },
{ "saveheaders", &opt.save_headers, cmd_boolean },

View File

@ -162,6 +162,7 @@ Logging and input file:\n\
fputs (_("\
Download:\n\
-t, --tries=NUMBER set number of retries to NUMBER (0 unlimits).\n\
--retry-connrefused retry even if connection is refused.\n\
-O --output-document=FILE write documents to FILE.\n\
-nc, --no-clobber don\'t clobber existing files or use .# suffixes.\n\
-c, --continue resume getting a partially-downloaded file.\n\
@ -294,6 +295,7 @@ main (int argc, char *const *argv)
{ "recursive", no_argument, NULL, 'r' },
{ "relative", no_argument, NULL, 'L' },
{ "retr-symlinks", no_argument, NULL, 137 },
{ "retry-connrefused", no_argument, NULL, 174 },
{ "save-headers", no_argument, NULL, 's' },
{ "server-response", no_argument, NULL, 'S' },
{ "span-hosts", no_argument, NULL, 'H' },
@ -515,6 +517,9 @@ GNU General Public License for more details.\n"));
case 'x':
setval ("dirstruct", "on");
break;
case 174:
setval ("retryconnrefused", "on");
break;
/* Options accepting an argument: */
case 129:

View File

@ -35,6 +35,7 @@ struct options
int verbose; /* Are we verbose? */
int quiet; /* Are we quiet? */
int ntry; /* Number of tries per URL */
int retry_connrefused; /* Treat CONNREFUSED as non-fatal. */
int background; /* Whether we should work in background. */
int kill_longer; /* Do we reject messages with *more*
data than specified in

View File

@ -326,4 +326,7 @@ typedef unsigned char boolean;
retrieve the requisites of a single document. */
#define INFINITE_RECURSION -1
#define CONNECT_ERROR(x) ((x) == ECONNREFUSED && !opt.retry_connrefused \
? CONREFUSED : CONERROR)
#endif /* WGET_H */