Revision cae80b1f src/PeerSampler/ncast.c

View differences:

src/PeerSampler/ncast.c
96 96
{
97 97
  struct tag *cfg_tags;
98 98
  struct peersampler_context *context;
99
  int res, max_timestamp;
99
  int max_timestamp;
100 100

  
101 101
  context = ncast_context_init();
102 102
  if (!context) return NULL;
103 103

  
104 104
  cfg_tags = config_parse(config);
105
  res = config_value_int_default(cfg_tags, "cache_size", &context->cache_size, DEFAULT_CACHE_SIZE);
106
  res = config_value_int_default(cfg_tags, "max_timestamp", &max_timestamp, DEFAULT_MAX_TIMESTAMP);
107
  res = config_value_int_default(cfg_tags, "period", &context->period, DEFAULT_PERIOD);
108
  res = config_value_int_default(cfg_tags, "bootstrap_period", &context->bootstrap_period, DEFAULT_BOOTSTRAP_PERIOD);
109
  res = config_value_int_default(cfg_tags, "bootstrap_cycles", &context->bootstrap_cycles, DEFAULT_BOOTSTRAP_CYCLES);
110
  res = config_value_int_default(cfg_tags, "adaptive", &context->adaptive, plus_features);
111
  res = config_value_int_default(cfg_tags, "restart", &context->restart, plus_features);
112
  res = config_value_int_default(cfg_tags, "randomize", &context->randomize, plus_features);
113
  res = config_value_int_default(cfg_tags, "slowstart", &context->slowstart, plus_features);
105
  config_value_int_default(cfg_tags, "cache_size", &context->cache_size, DEFAULT_CACHE_SIZE);
106
  config_value_int_default(cfg_tags, "max_timestamp", &max_timestamp, DEFAULT_MAX_TIMESTAMP);
107
  config_value_int_default(cfg_tags, "period", &context->period, DEFAULT_PERIOD);
108
  config_value_int_default(cfg_tags, "bootstrap_period", &context->bootstrap_period, DEFAULT_BOOTSTRAP_PERIOD);
109
  config_value_int_default(cfg_tags, "bootstrap_cycles", &context->bootstrap_cycles, DEFAULT_BOOTSTRAP_CYCLES);
110
  config_value_int_default(cfg_tags, "adaptive", &context->adaptive, plus_features);
111
  config_value_int_default(cfg_tags, "restart", &context->restart, plus_features);
112
  config_value_int_default(cfg_tags, "randomize", &context->randomize, plus_features);
113
  config_value_int_default(cfg_tags, "slowstart", &context->slowstart, plus_features);
114 114
  free(cfg_tags);
115 115

  
116 116
  context->local_cache = cache_init(context->cache_size, metadata_size, max_timestamp);

Also available in: Unified diff