]> sjero.net Git - wget/blobdiff - src/main.c
[svn] Changed my address from dan-wget@dilvish.speed.net to wget@harkless.org
[wget] / src / main.c
index ca4f7f233fc40eff7d6088fcb92a80cd5200db01..dda2ba92b02f4a866efe163bb4c94696f6d5c9f3 100644 (file)
@@ -39,6 +39,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 # include <locale.h>
 #endif /* HAVE_LOCALE_H */
 #endif /* HAVE_NLS */
+#include <errno.h>
 
 #define OPTIONS_DEFINED_HERE   /* for options.h */
 
@@ -162,7 +163,7 @@ Download:\n\
        --spider                 don\'t download anything.\n\
   -T,  --timeout=SECONDS        set the read timeout to SECONDS.\n\
   -w,  --wait=SECONDS           wait SECONDS between retrievals.\n\
-       --waitretry=SECONDS     wait 1...SECONDS between retries of a retrieval.\n\
+       --waitretry=SECONDS      wait 1...SECONDS between retries of a retrieval.\n\
   -Y,  --proxy=on/off           turn proxy on or off.\n\
   -Q,  --quota=NUMBER           set retrieval quota to NUMBER.\n\
 \n"),  _("\
@@ -247,6 +248,7 @@ main (int argc, char *const *argv)
     { "no-directories", no_argument, NULL, 19 },
     { "no-host-directories", no_argument, NULL, 20 },
     { "no-host-lookup", no_argument, NULL, 22 },
+    { "no-http-keep-alive", no_argument, NULL, 28 },
     { "no-parent", no_argument, NULL, 5 },
     { "non-verbose", no_argument, NULL, 18 },
     { "passive-ftp", no_argument, NULL, 11 },
@@ -327,7 +329,7 @@ main (int argc, char *const *argv)
   /* [Is the order of the option letters significant?  If not, they should be
       alphabetized, like the long_options.  The only thing I know for sure is
       that the options with required arguments must be followed by a ':'.
-      -- Dan Harkless <dan-wget@dilvish.speed.net>] */
+      -- Dan Harkless <wget@harkless.org>] */
   while ((c = getopt_long (argc, argv, "\
 hpVqvdkKsxmNWrHSLcFbEY:G:g:T:U:O:l:n:i:o:a:t:D:A:R:P:B:e:Q:X:I:w:",
                           long_options, (int *)0)) != EOF)
@@ -385,6 +387,9 @@ hpVqvdkKsxmNWrHSLcFbEY:G:g:T:U:O:l:n:i:o:a:t:D:A:R:P:B:e:Q:X:I:w:",
        case 27:
          setval ("bindaddress", optarg);
          break;
+       case 28:
+         setval ("httpkeepalive", "off");
+         break;
        case 'b':
          setval ("background", "on");
          break;
@@ -531,8 +536,8 @@ GNU General Public License for more details.\n"));
                         optarg);
                exit (1);
              }
-           free (com);
-           free (val);
+           xfree (com);
+           xfree (val);
          }
          break;
        case 'G':
@@ -579,6 +584,9 @@ GNU General Public License for more details.\n"));
                case 'p':
                  setval ("noparent", "on");
                  break;
+               case 'k':
+                 setval ("httpkeepalive", "off");
+                 break;
                default:
                  printf (_("%s: illegal option -- `-n%c'\n"), exec_name, *p);
                  print_usage ();
@@ -719,12 +727,15 @@ Can't timestamp and not clobber old files at the same time.\n"));
        opt.dfp = stdout;
       else
        {
+         struct stat st;
          opt.dfp = fopen (opt.output_document, "wb");
          if (opt.dfp == NULL)
            {
              perror (opt.output_document);
              exit (1);
            }
+         if (fstat (fileno (opt.dfp), &st) == 0 && S_ISREG (st.st_mode))
+           opt.od_known_regular = 1;
        }
     }
 
@@ -796,12 +807,15 @@ Can't timestamp and not clobber old files at the same time.\n"));
                   _("Download quota (%s bytes) EXCEEDED!\n"),
                   legible (opt.quota));
     }
-  if (opt.convert_links & !opt.delete_after)
+  if (opt.convert_links && !opt.delete_after)
     {
       convert_all_links ();
     }
   log_close ();
   cleanup ();
+#ifdef DEBUG_MALLOC
+  print_malloc_debug_stats ();
+#endif
   if (status == RETROK)
     return 0;
   else