Selaa lähdekoodia

Add tests for correctness.

master
Richard Nyberg 19 vuotta sitten
vanhempi
commit
2904cdca2d
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. +2
    -0
      btpd/peer.c

+ 2
- 0
btpd/peer.c Näytä tiedosto

@@ -125,6 +125,7 @@ peer_choke(struct peer *p)
void
peer_want(struct peer *p, uint32_t index)
{
assert(p->nwant < p->npieces);
p->nwant++;
if (p->nwant == 1) {
p->flags |= PF_I_WANT;
@@ -135,6 +136,7 @@ peer_want(struct peer *p, uint32_t index)
void
peer_unwant(struct peer *p, uint32_t index)
{
assert(p->nwant > 0);
p->nwant--;
if (p->nwant == 0) {
p->flags &= ~PF_I_WANT;


Loading…
Peruuta
Tallenna