aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_rcl.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-09-30 17:06:24 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-09-30 17:06:24 +0100
commitfe4b87bc2dc20eff0fa0083e23ebaa9ba10727ce (patch)
tree1819ce1e301964fa52b6b969a19251ff834f8485 /src/cfg_rcl.c
parenta932b82cdc9c1b6f3b81f18ed27305e3243df698 (diff)
downloadrspamd-fe4b87bc2dc20eff0fa0083e23ebaa9ba10727ce.tar.gz
rspamd-fe4b87bc2dc20eff0fa0083e23ebaa9ba10727ce.zip
Allow parsing uint32 as time values.
Diffstat (limited to 'src/cfg_rcl.c')
-rw-r--r--src/cfg_rcl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cfg_rcl.c b/src/cfg_rcl.c
index 15f5b7e9a..bf1b8ad70 100644
--- a/src/cfg_rcl.c
+++ b/src/cfg_rcl.c
@@ -809,6 +809,7 @@ rspamd_rcl_parse_struct_time (struct config_file *cfg, rspamd_cl_object_t *obj,
struct rspamd_rcl_struct_parser *pd = ud;
union {
gint *psec;
+ guint32 *pu32;
gdouble *pdv;
struct timeval *ptv;
struct timespec *pts;
@@ -838,6 +839,10 @@ rspamd_rcl_parse_struct_time (struct config_file *cfg, rspamd_cl_object_t *obj,
target.psec = (gint *)(((gchar *)pd->user_struct) + pd->offset);
*target.psec = val * 1000;
}
+ else if (pd->flags == RSPAMD_CL_FLAG_TIME_UINT_32) {
+ target.pu32 = (guint32 *)(((gchar *)pd->user_struct) + pd->offset);
+ *target.pu32 = val * 1000;
+ }
else {
g_set_error (err, CFG_RCL_ERROR, EINVAL, "invalid flags to parse time value");
return FALSE;