[PATCH] Copying from non-local file to sftp kioslave fails

Michael Leupold lemma at confuego.org
Sat Dec 27 14:14:30 GMT 2008


Hi,

this fixes the problems that pop up when copying files from a non-local source 
to an sftp destination (eg sftp/tar/smb => sftp).

The main problem is that KIO::SlaveBase::readData(buffer) nulls the buffer if 
there's no data to read. sftpProtocol::sftpWrite outputs such a nulled buffer 
to a QDataStream which outputs 0xffffffff instead of the expected empty string 
(please note that this only happens at EOF).

Not writing if there's nothing more to write seems like the best solution. I 
checked the RFC and openssh's sftp and there's no need to do an "empty" write 
at the end of the file.

Still it would be great if someone could take a second look at it.

Regards,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kio-sftp-copy-from-nonlocal.diff
Type: text/x-patch
Size: 451 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081227/87c8b71e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081227/87c8b71e/attachment.sig>


More information about the kde-core-devel mailing list