From: Vsevolod Stakhov Date: Sat, 24 Jun 2017 11:18:39 +0000 (+0100) Subject: [Minor] Allow to use numeric database when parsing redis params X-Git-Tag: 1.6.2~81 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0c94fef8143f656efe800f47f63a42bc136208f9;p=rspamd.git [Minor] Allow to use numeric database when parsing redis params --- diff --git a/src/libserver/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend_redis.c index 9a6648d4d..f8bec8882 100644 --- a/src/libserver/fuzzy_backend_redis.c +++ b/src/libserver/fuzzy_backend_redis.c @@ -195,7 +195,12 @@ rspamd_fuzzy_backend_redis_try_ucl (struct rspamd_fuzzy_backend_redis *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;