Revision 32c9a7bc sched.c

View differences:

sched.c
24 24
///     helper functions
25 25
///==========================================================
26 26
//avoiding duplicate transactions
27
static int needs(int k, struct peer *p)
27
int needs(int k, const struct peer *p)
28 28
{
29 29
#ifdef NO_BUFFER
30 30
  return (!p->chunks[k] && !p->recv_chunks[k]);
31 31
#else
32 32
  register unsigned int idx = k & p->buf_mask;
33 33

  
34
  return ((!p->chunks[idx] || (p->chunks[idx]->chunk != k)) && !p->recv_chunks[idx]);
34
  return ((!p->chunks[idx] || (p->chunks[idx]->chunk < k)) && !p->recv_chunks[idx]);
35 35
#endif
36 36
}
37 37

  

Also available in: Unified diff