+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
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;
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;
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)
void rotate_backups (const char *);
+bool url_uses_proxy (const char *);
+
#endif /* RETR_H */