about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard Nyberg <rnyberg@murmeldjur.se>2005-12-01 14:39:29 +0000
committerRichard Nyberg <rnyberg@murmeldjur.se>2005-12-01 14:39:29 +0000
commitcbc1a81d06392b689726fb3f2aa4fa7b8b12e524 (patch)
treeaf5528c756ef033a2af67bd1f2ddeb090ec78585
parent7a5d04eed4ee5a746e779471789ea7b91430edeb (diff)
downloadbtpd-cbc1a81d06392b689726fb3f2aa4fa7b8b12e524.tar.gz
btpd-cbc1a81d06392b689726fb3f2aa4fa7b8b12e524.zip
dl_on_lost_peer must remove the peer from the list. This was accidentally
removed in a previous commit. Fix indentation.

-rw-r--r--btpd/download.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/btpd/download.c b/btpd/download.c
index bc6bd5d..94855bf 100644
--- a/btpd/download.c
+++ b/btpd/download.c
@@ -180,10 +180,11 @@ dl_on_lost_peer(struct peer *p)
     assert(tp->npeers > 0 && (p->flags & PF_ATTACHED) != 0);
     tp->npeers--;
     p->flags &= ~PF_ATTACHED;
+    BTPDQ_REMOVE(&tp->peers, p, p_entry);
 
     for (uint32_t i = 0; i < tp->meta.npieces; i++)
         if (peer_has(p, i))
-                tp->piece_count[i]--;
+            tp->piece_count[i]--;
 
     if (p->nreqs_out > 0)
         dl_on_undownload(p);