]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Always return constant number of results from lua redis
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 4 May 2016 13:00:34 +0000 (14:00 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 4 May 2016 13:01:03 +0000 (14:01 +0100)
src/lua/lua_redis.c

index 55a85d22d9b9c6ab5df79997538bdc4e1674d53c..2e19cc4d4c5fdefffac9845320f7b3c19639fc56 100644 (file)
@@ -634,8 +634,9 @@ lua_redis_make_request (lua_State *L)
 
                        REF_RELEASE (ctx);
                        lua_pushboolean (L, FALSE);
+                       lua_pushnil (L);
 
-                       return 1;
+                       return 2;
                }
 
                redisAsyncSetConnectCallback (ud->ctx, lua_redis_connect_cb);
@@ -686,11 +687,12 @@ lua_redis_make_request (lua_State *L)
                pctx = lua_newuserdata (L, sizeof (ctx));
                *pctx = ctx;
                rspamd_lua_setclass (L, "rspamd{redis}", -1);
-
-               return 2;
+       }
+       else {
+               lua_pushnil (L);
        }
 
-       return 1;
+       return 2;
 }
 
 /***