guint max_word_len; /**< maximum length of the word to be considered */
guint words_decay; /**< limit for words for starting adaptive ignoring */
guint history_rows; /**< number of history rows stored */
- guint max_session_cache; /**< maximum number of sessions cache elts */
+ guint max_sessions_cache; /**< maximum number of sessions cache elts */
GList *classify_headers; /**< list of headers using for statistics */
struct module_s **compiled_modules; /**< list of compiled C modules */
0,
"Enable sessions cache to debug dangling sessions");
rspamd_rcl_add_default_handler (sub,
- "max_session_cache",
+ "max_sessions_cache",
rspamd_rcl_parse_struct_integer,
- G_STRUCT_OFFSET (struct rspamd_config, max_session_cache),
+ G_STRUCT_OFFSET (struct rspamd_config, max_sessions_cache),
0,
"Maximum number of sessions in cache before warning (default: 100)");
cfg->redis_pool = rspamd_redis_pool_init ();
#endif
cfg->default_max_shots = DEFAULT_MAX_SHOTS;
- cfg->max_session_cache = DEFAULT_MAX_SESSIONS;
+ cfg->max_sessions_cache = DEFAULT_MAX_SESSIONS;
REF_INIT_RETAIN (cfg, rspamd_config_free);
*e1 = *(const struct rspamd_worker_session_elt **)pa,
*e2 = *(const struct rspamd_worker_session_elt **)pb;
- return e1->when < e2->when;
+ return e2->when < e1->when;
}
static void
GPtrArray *res;
guint i;
- if (g_hash_table_size (c->cache) > c->cfg->max_session_cache) {
+ if (g_hash_table_size (c->cache) > c->cfg->max_sessions_cache) {
res = g_ptr_array_sized_new (g_hash_table_size (c->cache));
g_hash_table_iter_init (&it, c->cache);
}
msg_err ("sessions cache is overflowed %d elements where %d is limit",
- (gint)res->len, (gint)c->cfg->max_session_cache);
+ (gint)res->len, (gint)c->cfg->max_sessions_cache);
g_ptr_array_sort (res, rspamd_session_cache_sort_cmp);
PTR_ARRAY_FOREACH (res, i, elt) {