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

AdvancedChokeAlgorithm.ccp

Tags: None
(comma "," separated)
ron
Registered Member
Posts
1
Karma
0

AdvancedChokeAlgorithm.ccp

Sat Aug 18, 2007 3:18 am
Thanks joris for Ktorrent.

I was interested to know about choked and snubbed.
Durring reading the topic about banned Ktorrent clients, I had
the source of 2.0.1 in a browsertab.
Just for fun I did look the code and found the file 'AdvancedChokeAlgorithm.ccp' and start reading it.

I did found a inconsistent statement.
Code: Select all
// if the peer has less than 1 MB or 0.5 % of the torrent it is a newbie
if (p->percentAvailable() < 0.5 && stats.total_bytes * p->percentAvailable() < 1024*1024)
{
   nb = NEWBIE_BONUS;
}


Example file = 1GByte (1000MB) and I do have 2MB.
This is 0.2% so I should regarding the comment have less as 0.5% and be a newbie.
However it is more as 1MB, why should i not be a newbie anymore?

Detail:
In the comment is written :arrow: or and the if condition is :arrow: && instead of :arrow: ||.

Do I miss something? :roll:

Just to be safe I downloaded the code of 2.2.1 and found still the same.
The topic I was reading kTorrent banned from several private trackers - Why?
George
Moderator
Posts
5421
Karma
1

Sun Aug 19, 2007 11:18 am
You are right the comment doesn't match


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]