Waiting Users shows wrong % complete for segment transfers

Bug #188107 reported by MikeJJ
2
Affects Status Importance Assigned to Milestone
DC++
Fix Released
Low
Unassigned

Bug Description

Waiting Users shows wrong % complete for segment transfers

For a segmented transfer the % complete is displayed often as a few thousand percentage, e.g. 8890% complete.

I believe this is due to this line in UploadManager.cpp: line 177 in current svn (982).
    addFailedUpload(aSource, tFile +
     " (" + Util::toString((aStartPos*1000/(size+10))/10.0)+"% of " + Util::formatBytes(size) + " done)");

For example a 600mb file, start posistion 500mb, segment size 10mb, (if my maths is correct) will say it's at 5000%. Instead of 80%.
Not to sure of the best way to fix this. . . maybe replacing size with fileSize ?
(Also i don't understand why (size+10) has the +10 bit. :P)

MikeJJ (mrmikejj)
Changed in dcplusplus:
importance: Undecided → Low
Changed in dcplusplus:
status: New → Fix Committed
MikeJJ (mrmikejj)
Changed in dcplusplus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.