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

Michael Leupold lemma at confuego.org
Sun Dec 28 22:22:22 GMT 2008

On Sunday 28 December 2008 19:52:14 Thiago Macieira wrote:
> Michael Leupold wrote:
> >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.
> Sounds reasonable.
> A zero-read (empty buffer) means end-of-file in KIO. It should never be
> sent, unless it's an actual EOF.
> However, can you verify that this isn't the actual case of EOF?

With the additional information you gave me it looks that the 0 read means 
that the (remote) file to be copied is at its end. The sftp protocol doesn't 
need zero bytes sent to mark the end of the file. So I think it's safe to 
assume that >= can be replaced by >.  I will commit.

-------------- 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/20081228/0b446db5/attachment.sig>

More information about the kde-core-devel mailing list