Browse Source

Add peer_full function.

master
Richard Nyberg 19 years ago
parent
commit
1c14af0ab4
2 changed files with 7 additions and 0 deletions
  1. +6
    -0
      btpd/peer.c
  2. +1
    -0
      btpd/peer.h

+ 6
- 0
btpd/peer.c View File

@@ -550,3 +550,9 @@ peer_active_up(struct peer *p)
return (p->flags & (PF_P_WANT|PF_I_CHOKE)) == PF_P_WANT
|| p->npiece_msgs > 0;
}

int
peer_full(struct peer *p)
{
return p->npieces == p->n->tp->meta.npieces;
}

+ 1
- 0
btpd/peer.h View File

@@ -60,5 +60,6 @@ int peer_wanted(struct peer *p);
int peer_laden(struct peer *p);
int peer_has(struct peer *p, uint32_t index);
int peer_leech_ok(struct peer *p);
int peer_full(struct peer *p);

#endif

Loading…
Cancel
Save