[Kget] Review Request: Possible bug in saving of transfers when file already exists

Nikhil Marathe nsm.nikhil at gmail.com
Tue Apr 14 19:04:20 CEST 2009


Hi all,

NOTE: For the discussion below I've considered the simple KIO transfer plugin.
I think I might have found a bug in the case when a file which is to
be downloaded has already been downloaded. Also it seems this problem
is only with really small files ~1K. What seems to be happening is
that m_totalSize in Transfer never gets incremented for some reason.
TransferKio::slotResult then sets m_downloadedSize to m_totalSize,
which means both of them become 0. So although the status is set to
finished, the next time KGet is started it again downloads this file
as the data hasn't been changed in transfers.kgt

I have been unable to understand exactly why this is happening for
small files, but I have tried a small fix, although I'm not sure if it
is the best way to do it.
I have attached the patch below. Please apply it in kdenetwork/kget

I am close to fixing bug 184127: Kget closes automatically when a
download is marked as finished in the list (
https://bugs.kde.org/show_bug.cgi?id=184127 ), but I can't really test
it properly until this issue is clarified.

Looking forward to your feedback.

Thanks a lot
Nikhil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transferKio.patch
Type: text/x-patch
Size: 765 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kget/attachments/20090414/3dc62c36/attachment.patch 


More information about the Kget mailing list