瀏覽代碼

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 20 年之前
父節點
當前提交
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 void
cm_on_choke(struct peer *p) cm_on_choke(struct peer *p)
{ {
if (peer_wanted(p)) if (p->nreqs_out > 0)
cm_on_undownload(p); cm_on_undownload(p);
} }


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


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


||||||
x
 
000:0
Loading…
取消
儲存