This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[bug] svn 502324 adjusting max upload speed only works...

Tags: None
(comma "," separated)
George
Moderator
Posts
5421
Karma
1

Wed Feb 01, 2006 7:21 am
convoi wrote:i reenabled it in my current build.


Damn, missed that in your previous build.

the problem is in your Timer class.

Uint32 Timer::getElapsedSinceUpdate() const
{
QTime now = QTime::currentTime();
return last.msecsTo(now);
}


so, Qtime.msecsTo() returns an int. not an unsigned.
When I change my system time to somewhen earlier, last.msecsTo(now) is negative which therefor overflows when it is converted to Uint32.


I can't help it if you change your system timer, most peole however do not change it every 5 seconds. But I can check for the overflow, and if it is negative default to the update interval.

Actually I don't seem to understand, why it is so necessary to calculate the exact time. Your update timer fires every 100msecs. On my system,
double el = timer.getElapsedSinceUpdate(); is always around 100 msecs, ok, sometimes it's 96, sometimes it's 103. so why not just take the timer signal? if let's they some realtime mode process was starting to crunsh numbers and ktorrent and qtimer wouldn't be running for 30 seconds, and somone leeching from me, wouldn't be getting any packets, so be it. With the current system he would get maximum bandwidth when ktorrent finally gets the cpu again, while with just qtimer he would get the normal bandwidth..
not sure if I made it clear..


Accuracy, I don't know when after the QTimer fired, the uploader will get called, that might be around 100 most of the time, but if you have got lots of torrents, that can be longer.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]