[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    patch - ftp.cc
From:       Julian Rockey <linux () jrockey ! com>
Date:       2001-09-03 21:48:57
[Download RAW message or body]

Further to my note earlier on the kde-devel list about the problem with 
StatJob not responding with a result() signal ( 
http://lists.kde.org/?l=kde-devel&m=99937316627093&w=2 ), from what I can see 
in kio/ftp/ftp.cc if a stat is done on 
a file for which a directory does not exist, error will be properly issued. 
I.e. if a stat is done for ftp://myhost.com/dir1/dir2/dir3/file.txt then if 
the directory dir3 does not exist StatJob will not return a result() signal. 
This seems incorrect to me as I think it should return an ERR_DOES_NOT_EXIST.

The one line patch attached seems to fix this. However whoever wrote ftp.cc 
might want to take a look before committing as I am not familiar with the 
code and the comment suggests the author believes an error should have been 
issued. However ftpSendCmd does not issue an error if the expected return 
code was not returned from the FTP server - it just returns false.

I've run kdelibs release 2.2 with this patch installed for a few days and have 
not had any problems. It fixes the hanging problem in the app I'm developing 
though.

If this patch is accepted as the right thing to do I'll look at ftp.cc in more 
detail to see if there are other calls to ftpSendCmd that might need to signal 
an error on a 'false' return. Another problem I have noticed is that StatJob 
does not return modification times etc. for hidden files (beginning with '.') 
which may or may not be related.

rgds
Julian



["ftp.diff" (text/x-diff)]

Index: ftp.cc
===================================================================
RCS file: /home/kde/kdelibs/kio/ftp/ftp.cc,v
retrieving revision 1.147
diff -u -3 -p -r1.147 ftp.cc
--- ftp.cc	2001/07/29 21:12:53	1.147
+++ ftp.cc	2001/09/01 22:20:56
@@ -1358,6 +1358,7 @@ void Ftp::stat( const KURL &url)
   {
     kdDebug(7102) << "stat: Could not go to parent directory" << endl;
     // error already emitted
+    error( ERR_DOES_NOT_EXIST, path );
     return;
   }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic