KIO slave using copy() - problem with canResume()

David Faure faure at kde.org
Tue Mar 9 19:45:51 GMT 2004


On Monday 08 March 2004 11:48, Dr. Juergen Pfennig wrote:
> Hello dear Gurus,
> 
> a while ago I proposed to use copy jobs to call the copy() method of kio 
> slaves to improve the performance of get/put when one side of the transfer is 
> a local file. Until now only kio_file implemented this, other slaves relied 
> on the data pump implementation (making the data cross process boundaries).
> 
> I now have a working implementation for kio_ftp that also implements resume, 
> but I am only 95% happy with it. I would for example like to call canResume() 
> if I find .part file locally. Unfortunately this doesn't work. canResume() 
> tries to send metadata from the calling end of the data-pump kio_slave to 
> other side of the data pump. 

Yes, I designed the resuming stuff for the data-pump case only, at the time.
When using copy(), canResume doesn't even do anything, does it?
No TransferJob is being used, so the canResume signal is just ignored.

> In other words: while a copy job executes inside  
> copy() the KIO::slavebase members mOutgoingMetaData and mIncomingMetaData 
> should be equal, so that if you send meta data (to yourself) you will able to 
> receive it. This would make canResume() work with copy.

I don't think this is the solution - metadata is used in the data-pump case only
because we're starting the get job afterwards. We don't need metadata at all
to communicate with the slave's copy().

I have implemented what I think is the solution for this, see patch attached.
Totally untested, but quite straightforward.

From your copy() implementation, if you notice that the transfer can be resumed,
do the usual    if (canResume(offset)) { .... }, it should now ask the user and
return true if the user confirmed the resuming.
If it doesn't work, we'll debug this in private mail :)
Once it works we might have to do the same with m_moveJob.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: directcopyjob.diff
Type: text/x-diff
Size: 7109 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040309/6f602010/attachment.diff>


More information about the kde-core-devel mailing list