浏览代码

The test for if we should call cm_on_undownload or not wasn't

totally correct. Since there's a possibility that we've assigned
requests to peer and then decreased the wanted level, we could've
missed peers with requests but a wanted level of zero.

Now we check if the peer has any requests instead.
master
Richard Nyberg 19 年前
父节点
当前提交
0c794ac33a
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      btpd/policy_if.c

+ 2
- 2
btpd/policy_if.c 查看文件

@@ -81,7 +81,7 @@ cm_on_undownload(struct peer *p)
void
cm_on_choke(struct peer *p)
{
if (peer_wanted(p))
if (p->nreqs_out > 0)
cm_on_undownload(p);
}

@@ -217,7 +217,7 @@ cm_on_lost_peer(struct peer *p)
if (peer_has(p, i))
tp->piece_count[i]--;

if (peer_leech_ok(p))
if (p->nreqs_out > 0)
cm_on_undownload(p);
#if 0
struct piece *pc = BTPDQ_FIRST(&tp->getlst);


正在加载...
取消
保存