aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-11 16:48:52 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-11 16:48:52 +0000
commitc441c82c28b4e80d9380151fd894cb3b9a530e11 (patch)
tree4642b27a5300be73b91a3d99871c31734406d4bd /src/libserver
parentc81b768ae551c035afc4cec0295a6c1551342452 (diff)
downloadrspamd-c441c82c28b4e80d9380151fd894cb3b9a530e11.tar.gz
rspamd-c441c82c28b4e80d9380151fd894cb3b9a530e11.zip
Add options to limit cores for rspamd
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/cfg_file.h3
-rw-r--r--src/libserver/cfg_rcl.c15
2 files changed, 18 insertions, 0 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h
index 3c2b14da0..d145eaad4 100644
--- a/src/libserver/cfg_file.h
+++ b/src/libserver/cfg_file.h
@@ -234,6 +234,9 @@ struct rspamd_config {
gboolean disable_hyperscan; /**< disable hyperscan usage */
gsize max_diff; /**< maximum diff size for text parts */
+ gsize max_cores_size; /**< maximum size occupied by rspamd core files */
+ gsize max_cores_count; /**< maximum number of core files */
+ gchar *cores_dir; /**< directory for core files */
enum rspamd_log_type log_type; /**< log type */
gint log_facility; /**< log facility in case of syslog */
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index 751fa6964..f7a9a7be4 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -1470,6 +1470,21 @@ rspamd_rcl_config_init (void)
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, disable_hyperscan),
0);
+ rspamd_rcl_add_default_handler (sub,
+ "cores_dir",
+ rspamd_rcl_parse_struct_string,
+ G_STRUCT_OFFSET (struct rspamd_config, cores_dir),
+ RSPAMD_CL_FLAG_STRING_PATH);
+ rspamd_rcl_add_default_handler (sub,
+ "max_cores_size",
+ rspamd_rcl_parse_struct_integer,
+ G_STRUCT_OFFSET (struct rspamd_config, max_cores_size),
+ RSPAMD_CL_FLAG_INT_SIZE);
+ rspamd_rcl_add_default_handler (sub,
+ "max_cores_count",
+ rspamd_rcl_parse_struct_integer,
+ G_STRUCT_OFFSET (struct rspamd_config, max_cores_count),
+ RSPAMD_CL_FLAG_INT_SIZE);
/* New DNS configuration */
ssub = rspamd_rcl_add_section (&sub->subsections, "dns", NULL, NULL,