Ver código fonte

Fix an unsafe loop.

master
Richard Nyberg 20 anos atrás
pai
commit
7a5d04eed4
1 arquivos alterados com 4 adições e 2 exclusões
  1. +4
    -2
      btpd/upload.c

+ 4
- 2
btpd/upload.c Ver arquivo

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


Carregando…
Cancelar
Salvar