]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix issues with multiple returns from lua
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 22 Jun 2016 16:34:27 +0000 (17:34 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 22 Jun 2016 16:34:27 +0000 (17:34 +0100)
src/lua/global_functions.lua
src/plugins/fuzzy_check.c
src/plugins/lua/ratelimit.lua

index f4f77ce5da50e8206d4fa6032b141957c4aa5bd6..720c99aa1bcddb60804f35e8839620d3fa3ad6d6 100644 (file)
@@ -142,7 +142,8 @@ function rspamd_redis_make_request(task, redis_params, key, is_write, callback,
     options['dbname'] = redis_params['db']
   end
 
-  return rspamd_redis.make_request(options),addr
+  local ret,conn = rspamd_redis.make_request(options)
+  return ret,conn,addr
 end
 
 function rspamd_str_split(s, sep)
index cf71f86cb46d6d6be55d1ad081d073399aac565f..a4abf3c9fcd48bc2c17aec98d731dedcec1c917f 100644 (file)
@@ -2255,7 +2255,7 @@ fuzzy_process_handler (struct rspamd_http_connection_entry *conn_ent,
 
                /* Check for flag */
                if (g_hash_table_lookup (rule->mappings,
-                       GINT_TO_POINTER (flag)) == NULL) {
+                               GINT_TO_POINTER (flag)) == NULL) {
                        msg_info_task ("skip rule %s as it has no flag %d defined"
                                        " false", rule->name, flag);
                        cur = g_list_next (cur);
index 4f8330cd3d6fb1e53d4ff95d969182e1d1a6503b..7493f0edea05c88eb809bd597b13591367488162 100644 (file)
@@ -211,7 +211,7 @@ local function set_limits(task, args)
   ret,_,upstream = rspamd_redis_make_request(task,
     redis_params, -- connect params
     key, -- hash key
-    false, -- is write
+    true, -- is write
     rate_set_cb, --callback
     cmd, -- command
     fun.totable(fun.map(function(l) return l[2] end, args)) -- arguments