]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to use numeric database when parsing redis params
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 24 Jun 2017 11:18:39 +0000 (12:18 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 24 Jun 2017 11:32:41 +0000 (12:32 +0100)
src/libserver/fuzzy_backend_redis.c

index 9a6648d4d7443bb0d2a1f8d5617c42f081a30668..f8bec888244cc7740829dc70196cabce02f09213 100644 (file)
@@ -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;