Registered Member
|
While poking around in the KTorrent UI I noticed that the upload slots did not appear to be distributed in accordance with the score associated with each peer. Upon further investigation I discovered that the peer list is not, in fact, sorted according to each peers' aca_score statistic, but instead appears to be randomly ordered at the time of the call to doUnchoking(). As a result, upload slots are being distributed at random rather than being allocated to the peers with the highest scores, which can only have a negative impact on the efficiency of the network, not to mention end-users' download rates.
The original code attempted sort the peer list by first calling ppl.setCompareFunc(ACACmp) and then qSort(ppl.begin(), ppl.end()). The problem with this is that the two-argument qSort() function uses the operator<() defined for the element-type of the list, in this case Peer*, and thus sorts the items rather uselessly by memory address rather than score. The following patch against libbtcore/torrent/advancedchokealgorithm.cpp achieves the expected behavior:
|
Moderator
|
You are right, this seems to be a porting error when KT was ported from KDE3 to KDE4.
Will fix it. |
Registered Member
|
Thank you nybble41 for investigating the problem and for the patch. And thanks Georges for ktorrent itself
This bug is actually quite critical. Despite a very massive upload bandwidth, I cannot download much because I keep uploading to the wrong people. This bug deserves its own release (ktorrent 3.3.4?). I am trying to compile from source, with the patch above applied, because I can't download much until I do, and can't wait for a kubuntu package with the above fix. |
Moderator
|
There is probably going to be a 3.3.4 in the weekend, I'm hoping to get that out together with 4.0beta2. |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]