mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Add support for --content-on-error.
This commit is contained in:
parent
2223ac8ce3
commit
fce4e757a2
6
NEWS
6
NEWS
@ -5,6 +5,12 @@ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||
See the end for copying conditions.
|
||||
|
||||
Please send GNU Wget bug reports to <bug-wget@gnu.org>.
|
||||
|
||||
* Changes in Wget X.Y.Z
|
||||
|
||||
** Add support for content-on-error. It allows to store the HTTP
|
||||
payload on 4xx or 5xx errors.
|
||||
|
||||
|
||||
* Changes in Wget 1.13.4
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
2011-10-02 Henrik Holst <henrik.holst@millistream.com> (tiny change)
|
||||
|
||||
* wget.texi (HTTP Options): Document option --content-on-error.
|
||||
|
||||
2011-09-27 Karl Berry <karl@freefriends.org> (tiny change)
|
||||
|
||||
* wget.texi: Make dir entry consistent with others.
|
||||
|
@ -1506,6 +1506,12 @@ This option is useful for some file-downloading CGI programs that use
|
||||
@code{Content-Disposition} headers to describe what the name of a
|
||||
downloaded file should be.
|
||||
|
||||
@cindex Content On Error
|
||||
@item --content-on-error
|
||||
|
||||
If this is set to on, wget will not skip the content when the server responds
|
||||
with a http status code that indicates error.
|
||||
|
||||
@cindex Trust server names
|
||||
@item --trust-server-names
|
||||
|
||||
|
@ -1,3 +1,14 @@
|
||||
2011-10-02 Henrik Holst <henrik.holst@millistream.com> (tiny change)
|
||||
* http.c (gethttp): If 'contentonerror' is used then do not
|
||||
skip the http body on 4xx and 5xx errors.
|
||||
|
||||
* init.c (commands): Add 'contentonerror'.
|
||||
|
||||
* main.c (print_help, option_data): Add new option 'contentonerror'
|
||||
to make wget not skip the http content on 4xx and 5xx errors.
|
||||
|
||||
* options.h: New variable 'content_on_error'.
|
||||
|
||||
2011-09-19 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||
|
||||
* main.c (print_version): Update copyright year.
|
||||
|
@ -2451,7 +2451,7 @@ read_header:
|
||||
type = NULL; /* We don't need it any more. */
|
||||
|
||||
/* Return if we have no intention of further downloading. */
|
||||
if (!(*dt & RETROKF) || head_only)
|
||||
if ((!(*dt & RETROKF) && !opt.content_on_error) || head_only)
|
||||
{
|
||||
/* In case the caller cares to look... */
|
||||
hs->len = 0;
|
||||
|
@ -139,6 +139,7 @@ static const struct {
|
||||
{ "chooseconfig", &opt.choose_config, cmd_file },
|
||||
{ "connecttimeout", &opt.connect_timeout, cmd_time },
|
||||
{ "contentdisposition", &opt.content_disposition, cmd_boolean },
|
||||
{ "contentonerror", &opt.content_on_error, cmd_boolean },
|
||||
{ "continue", &opt.always_rest, cmd_boolean },
|
||||
{ "convertlinks", &opt.convert_links, cmd_boolean },
|
||||
{ "cookies", &opt.cookies, cmd_boolean },
|
||||
|
@ -178,6 +178,7 @@ static struct cmdline_option option_data[] =
|
||||
{ "continue", 'c', OPT_BOOLEAN, "continue", -1 },
|
||||
{ "convert-links", 'k', OPT_BOOLEAN, "convertlinks", -1 },
|
||||
{ "content-disposition", 0, OPT_BOOLEAN, "contentdisposition", -1 },
|
||||
{ "content-on-error", 0, OPT_BOOLEAN, "contentonerror", -1 },
|
||||
{ "cookies", 0, OPT_BOOLEAN, "cookies", -1 },
|
||||
{ "cut-dirs", 0, OPT_VALUE, "cutdirs", -1 },
|
||||
{ WHEN_DEBUG ("debug"), 'd', OPT_BOOLEAN, "debug", -1 },
|
||||
@ -594,6 +595,8 @@ HTTP options:\n"),
|
||||
N_("\
|
||||
--content-disposition honor the Content-Disposition header when\n\
|
||||
choosing local file names (EXPERIMENTAL).\n"),
|
||||
N_("\
|
||||
--content-on-error output the received content on server errors.\n"),
|
||||
N_("\
|
||||
--auth-no-challenge send Basic HTTP authentication information\n\
|
||||
without first waiting for the server's\n\
|
||||
|
@ -130,6 +130,8 @@ struct options
|
||||
bool server_response; /* Do we print server response? */
|
||||
bool save_headers; /* Do we save headers together with
|
||||
file? */
|
||||
bool content_on_error; /* Do we output the content when the HTTP
|
||||
status code indicates a server error */
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
bool debug; /* Debugging on/off */
|
||||
|
Loading…
Reference in New Issue
Block a user