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

Lukas Appelhans l.appelhans at gmx.de
Tue Apr 14 19:20:33 CEST 2009


On Dienstag 14 April 2009 19:04:20 Nikhil Marathe wrote:
> 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
Hey!

Maybe it is even because the Server is not reporting the filesize to 
KIO/KGet... there were some cases as the Server didn't do that, Manolo knew 
about them afair... the original problem was that downloads cannot resume due 
to that, might this be a possible fix?

About #184127: Great stuff, looking forward to see a patch! =)

Lukas


More information about the Kget mailing list