diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-12-08 13:32:18 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-12-08 13:32:18 +0000 |
commit | d3d19ad641185f0fdb380705cb999e51dbbb5e50 (patch) | |
tree | b5d09483f57c8565777c358196277f7321aa13ea /src/libserver | |
parent | b6d78afab84d30a8a5d1a014f254355df7710ccb (diff) | |
download | rspamd-d3d19ad641185f0fdb380705cb999e51dbbb5e50.tar.gz rspamd-d3d19ad641185f0fdb380705cb999e51dbbb5e50.zip |
[Feature] Core: allow to emit soft reject on task timeout
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/cfg_file.h | 3 | ||||
-rw-r--r-- | src/libserver/cfg_rcl.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index edc1258dc..6d6ed6f62 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -317,6 +317,7 @@ struct rspamd_config { gboolean disable_pcre_jit; /**< Disable pcre JIT */ gboolean disable_lua_squeeze; /**< Disable lua rules squeezing */ gboolean own_lua_state; /**< True if we have created lua_state internally */ + gboolean soft_reject_on_timeout; /**< If true emit soft reject on task timeout (if not reject) */ gsize max_cores_size; /**< maximum size occupied by rspamd core files */ gsize max_cores_count; /**< maximum number of core files */ @@ -324,8 +325,8 @@ struct rspamd_config { gsize max_message; /**< maximum size for messages */ gsize max_pic_size; /**< maximum size for a picture to process */ gsize images_cache_size; /**< size of LRU cache for DCT data from images */ - gint default_max_shots; /**< default maximum count of symbols hits permitted (-1 for unlimited) */ gdouble task_timeout; /**< maximum message processing time */ + gint default_max_shots; /**< default maximum count of symbols hits permitted (-1 for unlimited) */ 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 b9934929f..d6aadc03e 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -1985,6 +1985,12 @@ rspamd_rcl_config_init (struct rspamd_config *cfg, GHashTable *skip_sections) RSPAMD_CL_FLAG_TIME_FLOAT, "Maximum time for checking a message"); rspamd_rcl_add_default_handler (sub, + "soft_reject_on_timeout", + rspamd_rcl_parse_struct_boolean, + G_STRUCT_OFFSET (struct rspamd_config, soft_reject_on_timeout), + 0, + "Emit soft reject if task timeout takes place"); + rspamd_rcl_add_default_handler (sub, "check_timeout", rspamd_rcl_parse_struct_time, G_STRUCT_OFFSET (struct rspamd_config, task_timeout), |