Procházet zdrojové kódy

A peer needs to be removed from the peer list before being handed to

dl_on_lost_peer.
Fix a type.
master
Richard Nyberg před 19 roky
rodič
revize
3c0e61e112
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. +3
    -3
      btpd/peer.c

+ 3
- 3
btpd/peer.c Zobrazit soubor

@@ -17,12 +17,12 @@ peer_kill(struct peer *p)
btpd_log(BTPD_L_CONN, "killed peer %p\n", p);

if (p->flags & PF_ATTACHED) {
BTPDQ_REMOVE(&p->n->peers, p, p_entry);
p->n->npeers--;
if (p->n->active) {
ul_on_lost_peer(p);
dl_on_lost_peer(p);
}
BTPDQ_REMOVE(&p->n->peers, p, p_entry);
p->n->npeers--;
} else
BTPDQ_REMOVE(&net_unattached, p, p_entry);
if (p->flags & PF_ON_READQ)
@@ -475,7 +475,7 @@ peer_on_request(struct peer *p, uint32_t index, uint32_t begin,
btpd_log(BTPD_L_MSG, "received request(%u,%u,%u) from %p\n",
index, begin, length, p);
if ((p->flags & PF_NO_REQUESTS) == 0) {
char *content;
uint8_t *content;
if (cm_get_bytes(p->n->tp, index, begin, length, &content) == 0) {
peer_send(p, nb_create_piece(index, begin, length));
peer_send(p, nb_create_torrentdata(content, length));


||||||
x
 
000:0
Načítá se…
Zrušit
Uložit