Review Request 116524: Make kio_ftp work with ftp server that don't support absolute path with SIZE command

Dawit Alemayehu adawit at kde.org
Fri Mar 7 06:44:33 GMT 2014



> On March 5, 2014, 7:47 a.m., David Faure wrote:
> > kioslave/ftp/ftp.cpp, line 2275
> > <https://git.reviewboard.kde.org/r/116524/diff/2/?file=251597#file251597line2275>
> >
> >     This is surely wrong.
> >     
> >     If you're in /home/dfaure (as the CWD would be, by default, on non-anonymous FTP)
> >     and you're downloading a file /home/dfaure/dir1/dir2/file.txt
> >     then surely you want to call
> >     
> >     SIZE dir1/dir2/file.txt
> >     
> >     and not
> >     
> >     SIZE home/dfaure/dir1/dir2/file.txt
> >     
> >     
> >     It has to be relative to the CWD, not just "skip the first slash", which only works if the CWD is "/".
> >     
> >     
> >     This gives two alternatives for the fix: make this code relative to the current CWD whatever it is, or call ftpFolder() with the directory name (e.g. /home/dfaure/dir1/dir2) followed by SIZE with just the filename. The latter sounds like it might work better on android (if it doesn't support absolute paths, maybe it doesn't support ../../foo/bar.txt either?).

I have not been able to test whether it supported ../../foo/bar.txt yet. However, making the code relative to m_currentPath seems to work just fine ; so I can avoid having to call ftpFolder and hence sending a cwd request.


- Dawit


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/116524/#review52013
-----------------------------------------------------------


On March 3, 2014, 12:16 a.m., Dawit Alemayehu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/116524/
> -----------------------------------------------------------
> 
> (Updated March 3, 2014, 12:16 a.m.)
> 
> 
> Review request for kdelibs and David Faure.
> 
> 
> Bugs: 168011 and 326292
>     http://bugs.kde.org/show_bug.cgi?id=168011
>     http://bugs.kde.org/show_bug.cgi?id=326292
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> This patch changes Ftp::ftpSize such that it has support for servers that do not allow absolute paths with the SIZE command. That means when sending the command "SIZE /somefile" fails, it will try sending "SIZE somefile" before giving up. See bug report for details.
> 
> 
> Diffs
> -----
> 
>   kioslave/ftp/ftp.cpp 5bb2e8d 
> 
> Diff: https://git.reviewboard.kde.org/r/116524/diff/
> 
> 
> Testing
> -------
> 
> Installed Ftp server from bug report on an Android device and run tests.
> 
> 
> Thanks,
> 
> Dawit Alemayehu
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140307/5083fb73/attachment.htm>


More information about the kde-core-devel mailing list