Revision df98cd3a som/TopologyManager/topocache.c

View differences:

som/TopologyManager/topocache.c
214 214
  return 0;
215 215
}
216 216

  
217
struct nodeID *rand_peer(struct peer_cache *c)
217
struct nodeID *rand_peer(struct peer_cache *c, void **meta)
218 218
{
219 219
  int j;
220 220

  
......
223 223
  }
224 224
  j = ((double)rand() / (double)RAND_MAX) * c->current_size;
225 225

  
226
  if (*meta) {
227
    *meta = c->metadata + (j * c->metadata_size);
228
  }
229

  
226 230
  return c->entries[j].id;
227 231
}
228 232

  

Also available in: Unified diff