Revision 22ebd96d streaming.c

View differences:

streaming.c
45 45
  return 0;
46 46
}
47 47

  
48
void send_bmap(struct peer *to)
48
struct chunkID_set *cb_to_bmap(struct chunk_buffer *chbuf)
49 49
{
50 50
  struct chunk *chunks;
51 51
  int num_chunks, i;
52 52
  struct chunkID_set *my_bmap = chunkID_set_init(0);
53
  chunks = cb_get_chunks(cb, &num_chunks);
53
  chunks = cb_get_chunks(chbuf, &num_chunks);
54 54

  
55 55
  for(i=0; i<num_chunks; i++) {
56 56
    chunkID_set_add_chunk(my_bmap, chunks[i].id);
57 57
  }
58
  return my_bmap;
59
}
58 60

  
59
  sendMyBufferMap(to->id, my_bmap, cb_size, 0);
61
void send_bmap(struct peer *to)
62
{
63
  struct chunkID_set *my_bmap = cb_to_bmap(cb);
64
   sendMyBufferMap(to->id, my_bmap, cb_size, 0);
60 65

  
61 66
  chunkID_set_clear(my_bmap,0);
62 67
  free(my_bmap);

Also available in: Unified diff