Review Request: Fix whitespace related bugs when listing directories in kio_ftp
David Faure
faure at kde.org
Mon Oct 1 09:30:41 BST 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106636/#review19675
-----------------------------------------------------------
kioslave/ftp/ftp.cpp
<http://git.reviewboard.kde.org/r/106636/#comment15653>
Does this really work? This method is being called in the middle of the parsing of "list" command output, so the output of the "SIZE" command issued by ftpFileExists will only come after the end of the directory listing, won't it?
Did you test this with a non-trivial folder? (10 elements should be enough, unless I'm missing some buffering somewhere).
It sounds to me like the filename fixing up should come *after* the full directory listing.
Also, this looks very slow. On a "normal" FTP directory without whitespace to be fixed up, this is going to issue one SIZE command per file and one CWD command per subdirectory (and a lot more in case of whitespace issues). Maybe we can do the fixing up only when retrieving a single file or entering a subdir later on, to avoid slowing down directory listing so much. On a large folder and a slow FTP server, this must be unbearably slower...
- David Faure
On Sept. 29, 2012, 5:01 p.m., Dawit Alemayehu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106636/
> -----------------------------------------------------------
>
> (Updated Sept. 29, 2012, 5:01 p.m.)
>
>
> Review request for kdelibs and David Faure.
>
>
> Description
> -------
>
> The attached patch fixes a regression caused by a commit to fix bug# 88575. Namely, it fixed a problem where filenames with whitespaces in them were not handled correctly by kio_ftp. That is because the filenames were automatically trimmed when read from the directory. However, the fix then re-introduced the original bug and the reason why names were automatically trimmed in the first place. Some ftp servers add bogus whitespace between the date and filename in their listings. Hence, we need need to fix both of these opposing issues without breaking the other. This patch tries to do just that by actually validating each name entry that starts with a whitespace. That way the correct name is sent to the client.
>
>
> This addresses bug 300988.
> http://bugs.kde.org/show_bug.cgi?id=300988
>
>
> Diffs
> -----
>
> kioslave/ftp/ftp.h 2465a4b
> kioslave/ftp/ftp.cpp 26be283
>
> Diff: http://git.reviewboard.kde.org/r/106636/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Dawit Alemayehu
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20121001/33b6f53a/attachment.htm>
More information about the kde-core-devel
mailing list