]> sjero.net Git - wget/commitdiff
[svn] Fixed problem with recursive FTP retrieval.
authorhniksic <devnull@localhost>
Tue, 21 Nov 2006 22:18:12 +0000 (14:18 -0800)
committerhniksic <devnull@localhost>
Tue, 21 Nov 2006 22:18:12 +0000 (14:18 -0800)
src/ChangeLog
src/main.c
src/retr.c
src/retr.h

index 64177542c559f7809f097dac157e68af9cc9b572..d4fc68fd622698e805878ef510c8df68f4d769d6 100644 (file)
@@ -1,3 +1,12 @@
+2006-11-21  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * retr.c (retrieve_from_file): Ditto.
+       (url_uses_proxy): New function.
+
+       * main.c (main): Don't check for opt.use_proxy when deciding
+       whether to call retrieve_url or retrieve_tree; check whether the
+       proxy would be used for *this* URL.
+
 2006-10-17  Mike Grant  <mggr@pml.ac.uk>
 
        * ftp.c (ftp_loop_internal): Would incorrectly skip changing
index 1f3880fdf302f542947dfef6302532ef76a471a3..790b0279bd11224de1d8a1b65b5f151a0d86a6fd 100644 (file)
@@ -967,7 +967,7 @@ Can't timestamp and not clobber old files at the same time.\n"));
       int dt;
 
       if ((opt.recursive || opt.page_requisites)
-          && (url_scheme (*t) != SCHEME_FTP || opt.use_proxy))
+          && (url_scheme (*t) != SCHEME_FTP || url_uses_proxy (*t)))
         {
           int old_follow_ftp = opt.follow_ftp;
 
index 469433ca312eebca16a78df17aeac1f10abced8c..a2d462a87b34a206c6875e678b11d16fcd7b4de2 100644 (file)
@@ -844,7 +844,7 @@ retrieve_from_file (const char *file, bool html, int *count)
          break;
        }
       if ((opt.recursive || opt.page_requisites)
-         && (cur_url->url->scheme != SCHEME_FTP || opt.use_proxy))
+         && (cur_url->url->scheme != SCHEME_FTP || getproxy (cur_url->url)))
        {
          int old_follow_ftp = opt.follow_ftp;
 
@@ -1022,6 +1022,20 @@ getproxy (struct url *u)
   return proxy;
 }
 
+/* Returns true if URL would be downloaded through a proxy. */
+
+bool
+url_uses_proxy (const char *url)
+{
+  bool ret;
+  struct url *u = url_parse (url, NULL);
+  if (!u)
+    return false;
+  ret = getproxy (u) != NULL;
+  url_free (u);
+  return ret;
+}
+
 /* Should a host be accessed through proxy, concerning no_proxy?  */
 static bool
 no_proxy_match (const char *host, const char **no_proxy)
index 645fde5578f15f9705087fe3458756f745449a5b..930f70002da54c676f3b2ac39d46df10cc07c153 100644 (file)
@@ -61,4 +61,6 @@ void sleep_between_retrievals (int);
 
 void rotate_backups (const char *);
 
+bool url_uses_proxy (const char *);
+
 #endif /* RETR_H */