From e9c35582e7b22661975f5898891d02bbe9651ebf Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 19 Mar 2018 14:13:02 +0000 Subject: [Minor] Allow to parse integer database names for Redis Issue: #2083 Closes: #2083 --- src/libstat/backends/redis_backend.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libstat/backends/redis_backend.c') 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; -- cgit v1.2.3