int ttl;
int epoch;
int stats;
+ int max_entries;
CONF_SECTION *cs;
rbtree_t *cache;
fr_heap_t *heap;
rlm_cache_entry_t *c;
char buffer[1024];
+ if (rbtree_num_elements(inst->cache) >= inst->max_entries) {
+ RDEBUG("Cache is full: %d entries", inst->max_entries);
+ return NULL;
+ }
+
/*
* TTL of 0 means "don't cache this entry"
*/
offsetof(rlm_cache_t, key), NULL, NULL},
{ "ttl", PW_TYPE_INTEGER,
offsetof(rlm_cache_t, ttl), NULL, "500" },
+ { "max_entries", PW_TYPE_INTEGER,
+ offsetof(rlm_cache_t, max_entries), NULL, "16384" },
{ "epoch", PW_TYPE_INTEGER,
offsetof(rlm_cache_t, epoch), NULL, "0" },
{ "add-stats", PW_TYPE_BOOLEAN,