mirror of
https://github.com/mirror/wget.git
synced 2024-12-28 05:40:08 +08:00
[svn] Fixed problem with recursive FTP retrieval.
This commit is contained in:
parent
cd50595319
commit
3f51773542
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
16
src/retr.c
16
src/retr.c
@ -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)
|
||||
|
@ -61,4 +61,6 @@ void sleep_between_retrievals (int);
|
||||
|
||||
void rotate_backups (const char *);
|
||||
|
||||
bool url_uses_proxy (const char *);
|
||||
|
||||
#endif /* RETR_H */
|
||||
|
Loading…
Reference in New Issue
Block a user