+2007-07-28 Micah Cowan <micah@cowan.name>
+
+ * wget.texi <HTTP Options>: Added --max-redirect option.
+
2007-07-05 Micah Cowan <micah@cowan.name>
* fdl.texi:
In versions of Wget prior to 1.10 such use of @samp{--header} caused
sending of duplicate headers.
+@cindex redirect
+@item --max-redirect=@var{number}
+Specifies the maximum number of redirections to follow for a resource.
+The default is 20, which is usually far more than necessary. However, on
+those occasions where you want to allow more (or fewer), this is the
+option to use.
+
@cindex proxy user
@cindex proxy password
@cindex proxy authentication
+2007-07-28 Micah Cowan <micah@cowan.name>
+
+ * options.h, init.c, retr.c, main.c: renamed opt maxredirect
+ field to max_redirect, for improved consistency.
+ * init.c: changed max_redirect parser from cmd_number_inf to
+ cmd_number, as infinite redirects may not be appropriate.
+ Alternatively, if cmd_number_inf should be used, then
+ opt.max_redirect's value should be checked a bit differently in
+ retr.c, to allow for the "infinite" meaning of zero.
+
+2007-07-16 Joshua David Williams <yurimxpxman@gmail.com>
+
+ * options.h: added maxredirect to options struct
+ * init.c: added maxredirect to list of variables
+ * retr.c (retrieve_url): replaced MAX_REDIRECTIONS with opt.maxredirect
+ * main.c: added option --max-redirect
+
2007-07-16 Joshua David Williams <yurimxpxman@gmail.com>
* test.h: tests made more verbose; now displays the name
{ "loadcookies", &opt.cookies_input, cmd_file },
{ "logfile", &opt.lfilename, cmd_file },
{ "login", &opt.ftp_user, cmd_string },/* deprecated*/
+ { "maxredirect", &opt.max_redirect, cmd_number },
{ "mirror", NULL, cmd_spec_mirror },
{ "netrc", &opt.netrc, cmd_boolean },
{ "noclobber", &opt.noclobber, cmd_boolean },
opt.restrict_files_case = restrict_no_case_restriction;
opt.content_disposition = true;
+ opt.max_redirect = 20;
}
\f
/* Return the user's home directory (strdup-ed), or NULL if none is
{ "level", 'l', OPT_VALUE, "reclevel", -1 },
{ "limit-rate", 0, OPT_VALUE, "limitrate", -1 },
{ "load-cookies", 0, OPT_VALUE, "loadcookies", -1 },
+ { "max-redirect", 0, OPT_VALUE, "maxredirect", -1 },
{ "mirror", 'm', OPT_BOOLEAN, "mirror", -1 },
{ "no", 'n', OPT__NO, NULL, required_argument },
{ "no-clobber", 0, OPT_BOOLEAN, "noclobber", -1 },
--ignore-length ignore `Content-Length' header field.\n"),
N_("\
--header=STRING insert STRING among the headers.\n"),
+ N_("\
+ --max-redirect maximum redirections allowed per page.\n"),
N_("\
--proxy-user=USER set USER as proxy username.\n"),
N_("\
bool background; /* Whether we should work in background. */
bool ignore_length; /* Do we heed content-length at all? */
bool recursive; /* Are we recursive? */
- bool spanhost; /* Do we span across hosts in
+ bool spanhost; /* Do we span across hosts in
recursion? */
+ int max_redirect; /* Maximum number of times we'll allow
+ a page to redirect. */
bool relative_only; /* Follow only relative links. */
bool no_parent; /* Restrict access to the parent
directory. */
return dlrate;
}
\f
-/* Maximum number of allowed redirections. 20 was chosen as a
- "reasonable" value, which is low enough to not cause havoc, yet
- high enough to guarantee that normal retrievals will not be hurt by
- the check. */
-
-#define MAX_REDIRECTIONS 20
#define SUSPEND_POST_DATA do { \
post_data_suspended = true; \
mynewloc = xstrdup (newloc_parsed->url);
/* Check for max. number of redirections. */
- if (++redirection_count > MAX_REDIRECTIONS)
+ if (++redirection_count > opt.max_redirect)
{
logprintf (LOG_NOTQUIET, _("%d redirections exceeded.\n"),
- MAX_REDIRECTIONS);
+ opt.max_redirect);
url_free (newloc_parsed);
url_free (u);
xfree (url);