Revision 18d83f26 som/TopologyManager/ncast.c
som/TopologyManager/ncast.c | ||
---|---|---|
21 | 21 |
#include "msg_types.h" |
22 | 22 |
|
23 | 23 |
#define DEFAULT_CACHE_SIZE 10 |
24 |
#define DEFAULT_MAX_TIMESTAMP 5 |
|
24 | 25 |
|
25 | 26 |
static uint64_t currtime; |
26 | 27 |
static int cache_size; |
... | ... | |
56 | 57 |
int topInit(struct nodeID *myID, void *metadata, int metadata_size, const char *config) |
57 | 58 |
{ |
58 | 59 |
struct tag *cfg_tags; |
59 |
int res; |
|
60 |
int res, max_timestamp;
|
|
60 | 61 |
|
61 | 62 |
cfg_tags = config_parse(config); |
62 | 63 |
res = config_value_int(cfg_tags, "cache_size", &cache_size); |
63 | 64 |
if (!res) { |
64 | 65 |
cache_size = DEFAULT_CACHE_SIZE; |
65 | 66 |
} |
67 |
res = config_value_int(cfg_tags, "max_timestamp", &max_timestamp); |
|
68 |
if (!res) { |
|
69 |
max_timestamp = DEFAULT_MAX_TIMESTAMP; |
|
70 |
} |
|
66 | 71 |
free(cfg_tags); |
67 | 72 |
|
68 |
local_cache = cache_init(cache_size, metadata_size); |
|
73 |
local_cache = cache_init(cache_size, metadata_size, max_timestamp);
|
|
69 | 74 |
if (local_cache == NULL) { |
70 | 75 |
return -1; |
71 | 76 |
} |
Also available in: Unified diff