Revision e64fc7e5 streaming.c

View differences:

streaming.c
11 11
#include "streaming.h"
12 12
#include "output.h"
13 13
#include "input.h"
14
#include "dbg.h"
14 15

  
15 16
static struct chunk_buffer *cb;
16 17

  
......
58 59
  struct chunk *buff;
59 60
  int target, c, size;
60 61

  
61
  fprintf(stderr, "Send Chunk: %d neighbours\n", n);
62
  dprintf("Send Chunk: %d neighbours\n", n);
62 63
  if (n == 0) return;
63 64
  buff = cb_get_chunks(cb, &size);
64
  fprintf(stderr, "\t %d chunks in buffer...\n", size);
65
  dprintf("\t %d chunks in buffer...\n", size);
65 66
  if (size == 0) return;
66 67

  
67 68
  /************ STUPID DUMB SCHEDULING ****************/
68 69
  target = n * (rand() / (RAND_MAX + 1.0)); /*0..n-1*/
69 70
  c = size * (rand() / (RAND_MAX + 1.0)); /*0..size-1*/
70 71
  /************ /STUPID DUMB SCHEDULING ****************/
71
  fprintf(stderr, "\t sending chunk[%d]\n", buff[c].id);
72
  dprintf("\t sending chunk[%d]\n", buff[c].id);
72 73

  
73 74
  sendChunk(neighbours[target], buff + c);
74 75
}

Also available in: Unified diff