diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-19 14:13:02 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-19 14:13:02 +0000 |
commit | e9c35582e7b22661975f5898891d02bbe9651ebf (patch) | |
tree | ce71962cc4822b5f2f5c849478924f9e517ded06 /src/libstat/backends/redis_backend.c | |
parent | 8fd4189a09d89cbd49527282eeb9360858a24148 (diff) | |
download | rspamd-e9c35582e7b22661975f5898891d02bbe9651ebf.tar.gz rspamd-e9c35582e7b22661975f5898891d02bbe9651ebf.zip |
[Minor] Allow to parse integer database names for Redis
Issue: #2083
Closes: #2083
Diffstat (limited to 'src/libstat/backends/redis_backend.c')
-rw-r--r-- | src/libstat/backends/redis_backend.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index f191dc974..121162fc8 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -1256,7 +1256,12 @@ rspamd_redis_try_ucl (struct redis_stat_ctx *backend, elt = ucl_object_lookup_any (obj, "db", "database", "dbname", NULL); if (elt) { - backend->dbname = ucl_object_tostring (elt); + if (ucl_object_type (elt) == UCL_STRING) { + backend->dbname = ucl_object_tostring (elt); + } + else if (ucl_object_type (elt) == UCL_INT) { + backend->dbname = ucl_object_tostring_forced (elt); + } } else { backend->dbname = NULL; |