Browse Source

Fix an unsafe loop.

master
Richard Nyberg 19 years ago
parent
commit
7a5d04eed4
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      btpd/upload.c

+ 4
- 2
btpd/upload.c View File

@@ -42,10 +42,12 @@ ul_on_lost_peer(struct peer *p)
void void
ul_on_lost_torrent(struct torrent *tp) ul_on_lost_torrent(struct torrent *tp)
{ {
struct peer *p; struct peer *p = BTPDQ_FIRST(&m_peerq);
BTPDQ_FOREACH(p, &tp->peers, p_entry) { while (p != NULL) {
struct peer *next = BTPDQ_NEXT(p, p_entry);
BTPDQ_REMOVE(&m_peerq, p, ul_entry); BTPDQ_REMOVE(&m_peerq, p, ul_entry);
m_npeers--; m_npeers--;
p = next;
} }
choke_do(); choke_do();
} }


||||||
x
 
000:0
Loading…
Cancel
Save