[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [PATCH] FTPS support
From: |
Tim Ruehsen |
Subject: |
Re: [Bug-wget] [PATCH] FTPS support |
Date: |
Fri, 11 Sep 2015 10:54:37 +0200 |
User-agent: |
KMail/4.14.2 (Linux/4.1.0-2-amd64; KDE/4.14.2; x86_64; ; ) |
On Thursday 10 September 2015 16:05:14 Ander Juaristi Alamos wrote:
> > Hi Ander,
> >
> > during the last test I realized that --recursive won't work with FTPS.
>
> Hi Tim,
>
> If been looking through it and I've seen that the '--recursive' option from
> FTP and the one from FTPS follow different code paths.
>
> The code that triggers that difference is at main.c, line 1832:
>
> if ((opt.recursive || opt.page_requisites)
> && (url_scheme (*t) != SCHEME_FTP || url_uses_proxy
> (url_parsed))) {
> ...
> /* Turn opt.follow_ftp on in case of recursive FTP retrieval
> */ if (url_scheme (*t) == SCHEME_FTP)
> opt.follow_ftp = 1;
> ...
> }
>
> If I replace it to include FTPS also:
>
> if ((opt.recursive || opt.page_requisites)
> && ((url_scheme (*t) != SCHEME_FTP && url_scheme (*t) !=
> SCHEME_FTPS)
> || url_uses_proxy (url_parsed)))
>
> {
> ...
> /* Turn opt.follow_ftp on in case of recursive FTP retrieval
> */ if (url_scheme (*t) == SCHEME_FTP || url_scheme (*t) == SCHEME_FTPS)
> opt.follow_ftp = 1;
> ...
> }
>
> Then they both follow the same path. The rationale behind this is that the
> functionality for FTP should behave exactly the same for FTPS.
>
> However, it hangs when downloading the files... Will look further.
>
> Any thoughts?
Hi Ander,
two things that I found.
1. [PATCH 0002] Some FTPS pieces seem to be missing.
I went through the code by searching for SCHEME_FTP and "ftp" and added FTPS
stuff where it was missing. I did not think throughly about what I did - so
please just don't apply those changes blindly.
With those changes, Wget tried to work recursively but hangs on the first
PASSIVE data transfer.
2. [PATCH 0003 ]'using_data_security' in getftp() is a local variable, reset
for each file, and only set if (prot != PROT_CLEAR). I turned the logic and
voila, recursion works. Again, think if this change might break something else
that I didn't test.
Regards, Tim
0002-Some-missing-FTPS-pieces.patch
Description: Text Data
0003-Let-FTPS-work-recursive.patch
Description: Text Data