Ver código fonte

Add tests for correctness.

master
Richard Nyberg 19 anos atrás
pai
commit
2904cdca2d
1 arquivos alterados com 2 adições e 0 exclusões
  1. +2
    -0
      btpd/peer.c

+ 2
- 0
btpd/peer.c Ver arquivo

@@ -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;


Carregando…
Cancelar
Salvar