]> sjero.net Git - wget/blobdiff - src/main.c
[svn] Improve documentation of cookie code.
[wget] / src / main.c
index 148205ad412fda81e6bc3704a90d58e62e4e6ccb..42ba42d2ae557da46cd28ff59560d1d7707a6861 100644 (file)
@@ -60,6 +60,7 @@ so, delete this exception statement from your version.  */
 #include "cookies.h"
 #include "url.h"
 #include "progress.h"          /* for progress_handle_sigwinch */
+#include "convert.h"
 
 #ifdef HAVE_SSL
 # include "gen_sslfunc.h"
@@ -170,7 +171,10 @@ Download:\n\
   -N,  --timestamping           don\'t re-retrieve files unless newer than local.\n\
   -S,  --server-response        print server response.\n\
        --spider                 don\'t download anything.\n\
-  -T,  --timeout=SECONDS        set the read timeout to SECONDS.\n\
+  -T,  --timeout=SECONDS        set all timeout values to SECONDS.\n\
+       --dns-timeout=SECS       set the DNS lookup timeout to SECS.\n\
+       --connect-timeout=SECS   set the connect timeout to SECS.\n\
+       --read-timeout=SECS      set the read timeout to SECS.\n\
   -w,  --wait=SECONDS           wait SECONDS between retrievals.\n\
        --waitretry=SECONDS      wait 1...SECONDS between retries of a retrieval.\n\
        --random-wait            wait from 0...2*WAIT secs between retrievals.\n\
@@ -315,8 +319,10 @@ main (int argc, char *const *argv)
     { "base", required_argument, NULL, 'B' },
     { "bind-address", required_argument, NULL, 155 },
     { "cache", required_argument, NULL, 'C' },
+    { "connect-timeout", required_argument, NULL, 180 },
     { "cookies", required_argument, NULL, 160 },
     { "cut-dirs", required_argument, NULL, 145 },
+    { "dns-timeout", required_argument, NULL, 178 },
     { "directory-prefix", required_argument, NULL, 'P' },
     { "dns-cache", required_argument, NULL, 175 },
     { "domains", required_argument, NULL, 'D' },
@@ -346,6 +352,7 @@ main (int argc, char *const *argv)
     { "proxy-passwd", required_argument, NULL, 144 },
     { "proxy-user", required_argument, NULL, 143 },
     { "quota", required_argument, NULL, 'Q' },
+    { "read-timeout", required_argument, NULL, 179 },
     { "reject", required_argument, NULL, 'R' },
     { "restrict-file-names", required_argument, NULL, 176 },
     { "save-cookies", required_argument, NULL, 162 },
@@ -508,13 +515,13 @@ hpVqvdkKsxmNWrHSLcFbEY:G:g:T:U:O:l:n:i:o:a:t:D:A:R:P:B:e:Q:X:I:w:C:",
        case 'V':
          printf ("GNU Wget %s\n\n", version_string);
          printf ("%s", _("\
-Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.\n"));
+Copyright (C) 2003 Free Software Foundation, Inc.\n"));
          printf ("%s", _("\
 This program is distributed in the hope that it will be useful,\n\
 but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\
 GNU General Public License for more details.\n"));
-         printf (_("\nOriginally written by Hrvoje Niksic <hniksic@arsdigita.com>.\n"));
+         printf (_("\nOriginally written by Hrvoje Niksic <hniksic@xemacs.org>.\n"));
          exit (0);
          break;
        case 'v':
@@ -620,6 +627,15 @@ GNU General Public License for more details.\n"));
        case 176:
          setoptval ("restrictfilenames", optarg);
          break;
+       case 178:
+         setoptval ("dnstimeout", optarg);
+         break;
+       case 179:
+         setoptval ("readtimeout", optarg);
+         break;
+       case 180:
+         setoptval ("connecttimeout", optarg);
+         break;
        case 'A':
          setoptval ("accept", optarg);
          break;
@@ -787,9 +803,8 @@ Can't timestamp and not clobber old files at the same time.\n"));
   if (opt.verbose)
     set_progress_implementation (opt.progress_type);
 
-  /* Allocate basic pointer.  */
-  url = ALLOCA_ARRAY (char *, nurl + 1);
   /* Fill in the arguments.  */
+  url = alloca_array (char *, nurl + 1);
   for (i = 0; i < nurl; i++, optind++)
     {
       char *rewritten = rewrite_shorthand_url (argv[optind]);
@@ -912,9 +927,7 @@ Can't timestamp and not clobber old files at the same time.\n"));
     cookie_jar_save (wget_cookie_jar, opt.cookies_output);
 
   if (opt.convert_links && !opt.delete_after)
-    {
-      convert_all_links ();
-    }
+    convert_all_links ();
 
   log_close ();
   for (i = 0; i < nurl; i++)