1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Introduce `show_all_dns_entries'.

This commit is contained in:
Giuseppe Scrivano 2011-08-06 12:38:42 +02:00
parent 5db59de365
commit 1f06428483
7 changed files with 23 additions and 2 deletions

3
NEWS
View File

@ -65,6 +65,9 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
** Do not attempt to remove the file if it is not in the accept rules but ** Do not attempt to remove the file if it is not in the accept rules but
it is the output destination file. it is the output destination file.
** Introduce `show_all_dns_entries' to print all IP addresses corresponding to
a DNS name when it is resolved.
* Changes in Wget 1.12 * Changes in Wget 1.12

View File

@ -1,5 +1,7 @@
2011-08-06 Giuseppe Scrivano <gscrivano@gnu.org> 2011-08-06 Giuseppe Scrivano <gscrivano@gnu.org>
* wget.texi (Wgetrc Commands): Document show_all_dns_entries.
* Makefile.am (wget.pod): Pass the VERSION value to texi2pod. * Makefile.am (wget.pod): Pass the VERSION value to texi2pod.
* texi2pod.pl: Update from GCC. * texi2pod.pl: Update from GCC.

View File

@ -3171,6 +3171,10 @@ as @samp{--secure-protocol=@var{string}}.
Choose whether or not to print the @sc{http} and @sc{ftp} server Choose whether or not to print the @sc{http} and @sc{ftp} server
responses---the same as @samp{-S}. responses---the same as @samp{-S}.
@item show_all_dns_entries = on/off
When a DNS name is resolved, show all the IP addresses, not just the first
three.
@item span_hosts = on/off @item span_hosts = on/off
Same as @samp{-H}. Same as @samp{-H}.

View File

@ -1,5 +1,10 @@
2011-08-06 Giuseppe Scrivano <gscrivano@gnu.org> 2011-08-06 Giuseppe Scrivano <gscrivano@gnu.org>
* host.c (lookup_host): If `showalldnsentries' is used then print all
the IP corresponding to a DNS entry.
* init.c (commands): Add `showalldnsentries'.
Suggested by: Witold Baryluk <baryluk@smp.if.uj.edu.pl>
* http.c (gethttp): Add the Cache-Control HTTP header when --no-cache * http.c (gethttp): Add the Cache-Control HTTP header when --no-cache
is specified. is specified.
Reported by: Коренберг Марк <socketpair@gmail.com>. Reported by: Коренберг Марк <socketpair@gmail.com>.

View File

@ -822,11 +822,15 @@ lookup_host (const char *host, int flags)
#endif /* not ENABLE_IPV6 */ #endif /* not ENABLE_IPV6 */
/* Print the addresses determined by DNS lookup, but no more than /* Print the addresses determined by DNS lookup, but no more than
three. */ three if show_all_dns_entries is not specified. */
if (!silent && !numeric_address) if (!silent && !numeric_address)
{ {
int i; int i;
int printmax = al->count <= 3 ? al->count : 3; int printmax = al->count;
if (! opt.show_all_dns_entries)
printmax = 3;
for (i = 0; i < printmax; i++) for (i = 0; i < printmax; i++)
{ {
logputs (LOG_VERBOSE, print_address (al->addresses + i)); logputs (LOG_VERBOSE, print_address (al->addresses + i));

View File

@ -247,6 +247,7 @@ static const struct {
{ "secureprotocol", &opt.secure_protocol, cmd_spec_secure_protocol }, { "secureprotocol", &opt.secure_protocol, cmd_spec_secure_protocol },
#endif #endif
{ "serverresponse", &opt.server_response, cmd_boolean }, { "serverresponse", &opt.server_response, cmd_boolean },
{ "showalldnsentries", &opt.show_all_dns_entries, cmd_boolean },
{ "spanhosts", &opt.spanhost, cmd_boolean }, { "spanhosts", &opt.spanhost, cmd_boolean },
{ "spider", &opt.spider, cmd_boolean }, { "spider", &opt.spider, cmd_boolean },
{ "strictcomments", &opt.strict_comments, cmd_boolean }, { "strictcomments", &opt.strict_comments, cmd_boolean },

View File

@ -253,6 +253,8 @@ struct options
bool useservertimestamps; /* Update downloaded files' timestamps to bool useservertimestamps; /* Update downloaded files' timestamps to
match those on server? */ match those on server? */
bool show_all_dns_entries; /* Show all the DNS entries when resolving a
name. */
}; };
extern struct options opt; extern struct options opt;