]> sjero.net Git - wget/blobdiff - src/retr.c
Ted Mielczarek's CSS wonder-patch, applied against the source from around the time...
[wget] / src / retr.c
index 469433ca312eebca16a78df17aeac1f10abced8c..245eb129f40d5f49644d0bb69de1e7489f54cf1d 100644 (file)
@@ -51,6 +51,7 @@ so, delete this exception statement from your version.  */
 #include "hash.h"
 #include "convert.h"
 #include "ptimer.h"
+#include "html-url.h"
 
 /* Total size of downloaded files.  Used to enforce quota.  */
 SUM_SIZE_INT total_downloaded_bytes;
@@ -784,6 +785,8 @@ retrieve_url (const char *origurl, char **file, char **newloc,
            register_redirection (origurl, u->url);
          if (*dt & TEXTHTML)
            register_html (u->url, local_file);
+         if (*dt & TEXTCSS)
+           register_css (u->url, local_file);
        }
     }
 
@@ -844,7 +847,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 +1025,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)