https://bugs.kde.org/show_bug.cgi?id=508964

Nicolás <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |ASSIGNED

--- Comment #14 from Nicolás <[email protected]> ---
With the invaluable guidance of Jack Hill, I was able to fix it locally - my
next challenge is preparing a commit with 

1. In torrentstats.h, I added the following lines:

    //! TimeStamp when we last saw download activity during the current session
    TimeStamp session_last_download_activity_time;
    //! TimeStamp when we last saw upload activity during the current session
    TimeStamp session_last_upload_activity_time;

2. In torrentstats.cpp under namespace bt I've added the following lines. I
wonder if it's right to use the "(0)". My expectation is that property is reset
to 0 when starting a torrent, but since I can't see yet or understand the
workflow, I might be making a mistake:

    , session_last_download_activity_time(0)
    , session_last_upload_activity_time(session_last_download_activity_time)

3. In queuemanager.cpp I've renamed the stats called to "session_*":

static bool IsStalled(bt::TorrentInterface *tc, bt::TimeStamp now, bt::Uint32
min_stall_time)
{
    bt::Int64 stalled_time = 0;
    if (tc->getStats().completed) {
        stalled_time = (now - tc->getStats().session_last_upload_activity_time)
/ 1000;
    } else {
        stalled_time = (now -
tc->getStats().session_last_download_activity_time) / 1000;
    }

    return stalled_time > min_stall_time * 60 && tc->getStats().running;
}

4. In torrentcontrol.cpp function / module / procedure
TorrentControl::continueStart() I've added line #392:

stats.session_last_download_activity_time =
stats.session_last_upload_activity_time = CurrentTime();

I'll change the status to "Assigned" (to me with guidance from Jack, but I
don't have access to those fields).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to