> 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?). > > Dawit Alemayehu wrote: > 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.
I am done testing this patch and it seems to work with a bunch of different ftp servers I tried so far. I tested with whatever ftp.kde.org runs, the android ftp server that was the source of this fix and both pro-ftpd and vsftpd servers on my own machines. If there are no objections, I am going to commit this after the beta2 is out ; so it can go in for the next beta release. - Dawit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/116524/#review52013 ----------------------------------------------------------- On March 7, 2014, 6:48 a.m., Dawit Alemayehu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/116524/ > ----------------------------------------------------------- > > (Updated March 7, 2014, 6:48 a.m.) > > > Review request for kdelibs and David Faure. > > > Bugs: 326292 > 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 ddc6eaf > > 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 > >
