]> sjero.net Git - wget/commitdiff
Introduce `show_all_dns_entries'.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 6 Aug 2011 10:38:42 +0000 (12:38 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 6 Aug 2011 10:38:42 +0000 (12:38 +0200)
NEWS
doc/ChangeLog
doc/wget.texi
src/ChangeLog
src/host.c
src/init.c
src/options.h

diff --git a/NEWS b/NEWS
index 4d5e31b27bc3d38ce3749dba2af3b4094e9ce20b..123b63c5dbf9a6daf37f8e23e75a4c0c3c9b7c1b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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
    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.
 \f
 * Changes in Wget 1.12
 
index 7b59c341eec1d92c9a1d83aeae543c63424f75c7..5ce40d5c5e5af3f9e515486c7edfc9f3438374e9 100644 (file)
@@ -1,5 +1,7 @@
 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.
 
        * texi2pod.pl: Update from GCC.
index 7c2a69dd3cc86069cabebb7c7606fdbd31bae955..87b8f2ded976add7e8bff080589850848e296495 100644 (file)
@@ -3171,6 +3171,10 @@ as @samp{--secure-protocol=@var{string}}.
 Choose whether or not to print the @sc{http} and @sc{ftp} server
 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
 Same as @samp{-H}.
 
index b998e98fe5de8c2267b7565e971e01c9114d35eb..c96da02283f5aacba4b6d12efbd3d8b3a3ee7aa3 100644 (file)
@@ -1,5 +1,10 @@
 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
        is specified.
        Reported by: Коренберг Марк <socketpair@gmail.com>.
index 34dc7084a31d8cd358e603158da520226089875d..505f706c02a75233593f6a6e134a085193019dcb 100644 (file)
@@ -822,11 +822,15 @@ lookup_host (const char *host, int flags)
 #endif /* not ENABLE_IPV6 */
 
   /* 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)
     {
       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++)
         {
           logputs (LOG_VERBOSE, print_address (al->addresses + i));
index 17f9f9e6d7d38ef965a2e49f0192e94a1223e202..8f44cdb4f52709bebd5783002ccadad91c11e056 100644 (file)
@@ -247,6 +247,7 @@ static const struct {
   { "secureprotocol",   &opt.secure_protocol,   cmd_spec_secure_protocol },
 #endif
   { "serverresponse",   &opt.server_response,   cmd_boolean },
+  { "showalldnsentries", &opt.show_all_dns_entries, cmd_boolean },
   { "spanhosts",        &opt.spanhost,          cmd_boolean },
   { "spider",           &opt.spider,            cmd_boolean },
   { "strictcomments",   &opt.strict_comments,   cmd_boolean },
index 05e5894d1119692bb93ac78d6518a00519280f08..252bf81d395650f5ca5ea00948938d7744a450b5 100644 (file)
@@ -253,6 +253,8 @@ struct options
   bool useservertimestamps;    /* Update downloaded files' timestamps to
                                   match those on server? */
 
+  bool show_all_dns_entries; /* Show all the DNS entries when resolving a
+                                name. */
 };
 
 extern struct options opt;