Revision b88c9f4a topology.c

View differences:

topology.c
36 36
static int simpleRanker (const void *tin, const void *p1in, const void *p2in);
37 37
static tmanRankingFunction rankFunct = simpleRanker;
38 38
struct metadata {
39
  int cb_size;
39 40
  double value;
40 41
};
41 42
static struct metadata my_metadata;
......
46 47

  
47 48
static void update_metadata(void) {
48 49

  
50
	my_metadata.cb_size = am_i_source() ? 0 : get_cb_size();
49 51
#ifndef MONL
50 52
	my_metadata.value = 1 + (((double)rand() / (double)RAND_MAX)*1000);
51 53
#endif
......
151 153

  
152 154
void add_peer(const struct nodeID *id, const struct metadata *m)
153 155
{
154
      dprintf("Adding %s to neighbourhood!\n", node_addr(id));
156
      dprintf("Adding %s to neighbourhood! cb_size:%d\n", node_addr(id), m?m->cb_size:-1);
155 157
      peerset_add_peer(pset, id);
158
      if (m) peerset_get_peer(pset, id)->cb_size = m->cb_size;
156 159
      /* add measures here */
157 160
      add_measures(id);
158 161
      send_bmap(id);

Also available in: Unified diff