]> sjero.net Git - wget/blobdiff - src/init.c
[svn] New option `--limit-rate'.
[wget] / src / init.c
index f0a4f222fad9ad3160509ddedd4f93a16c272bb2..2b1db499f08cfa6bd2250964e1c9556697996916 100644 (file)
@@ -142,6 +142,7 @@ static struct {
   { "includedirectories", &opt.includes,       cmd_directory_vector },
   { "input",           &opt.input_filename,    cmd_file },
   { "killlonger",      &opt.kill_longer,       cmd_boolean },
+  { "limitrate",       &opt.limit_rate,        cmd_bytes },
   { "loadcookies",     &opt.cookies_input,     cmd_file },
   { "logfile",         &opt.lfilename,         cmd_file },
   { "login",           &opt.ftp_acc,           cmd_string },
@@ -160,6 +161,7 @@ static struct {
   { "proxyuser",       &opt.proxy_user,        cmd_string },
   { "quiet",           &opt.quiet,             cmd_boolean },
   { "quota",           &opt.quota,             cmd_bytes },
+  { "randomwait",      &opt.random_wait,       cmd_boolean },
   { "reclevel",                &opt.reclevel,          cmd_number_inf },
   { "recursive",       NULL,                   cmd_spec_recursive },
   { "referer",         &opt.referer,           cmd_string },
@@ -520,17 +522,22 @@ static int myatoi PARAMS ((const char *s));
 static int
 cmd_address (const char *com, const char *val, void *closure)
 {
+  struct address_list *al;
   struct sockaddr_in sin;
   struct sockaddr_in **target = (struct sockaddr_in **)closure;
 
   memset (&sin, '\0', sizeof (sin));
 
-  if (!lookup_host (val, (unsigned char *)&sin.sin_addr))
+  al = lookup_host (val, 1);
+  if (!al)
     {
       fprintf (stderr, _("%s: %s: Cannot convert `%s' to an IP address.\n"),
               exec_name, com, val);
       return 0;
     }
+  address_list_copy_one (al, 0, (unsigned char *)&sin.sin_addr);
+  address_list_release (al);
+
   sin.sin_family = AF_INET;
   sin.sin_port = 0;
 
@@ -1010,6 +1017,7 @@ check_user_specified_header (const char *s)
 void cleanup_html_url PARAMS ((void));
 void res_cleanup PARAMS ((void));
 void downloaded_files_free PARAMS ((void));
+void http_cleanup PARAMS ((void));
 
 
 /* Free the memory allocated by global variables.  */
@@ -1032,14 +1040,16 @@ cleanup (void)
 #ifdef DEBUG_MALLOC
   recursive_cleanup ();
   res_cleanup ();
+  http_cleanup ();
+  cleanup_html_url ();
+  downloaded_files_free ();
+  cookies_cleanup ();
   host_cleanup ();
+
   {
     extern acc_t *netrc_list;
     free_netrc (netrc_list);
   }
-  cleanup_html_url ();
-  downloaded_files_free ();
-  cookies_cleanup ();
   FREE_MAYBE (opt.lfilename);
   xfree (opt.dir_prefix);
   FREE_MAYBE (opt.input_filename);