From 8ea4bdd91d600aa1e9e1ebf7dace19172a7ce23a Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 17 Sep 2019 19:26:46 +0200 Subject: [PATCH] RESP3: Lua double -> RESP3 conversion. --- src/scripting.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/scripting.c b/src/scripting.c index 7230f7438..2153233f5 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -389,6 +389,17 @@ void luaReplyToRedisReply(client *c, lua_State *lua) { } lua_pop(lua,1); /* Discard field name pushed before. */ + /* Handle double reply. */ + lua_pushstring(lua,"double"); + lua_gettable(lua,-2); + t = lua_type(lua,-1); + if (t == LUA_TNUMBER) { + addReplyDouble(c,lua_tonumber(lua,-1)); + lua_pop(lua,2); + return; + } + lua_pop(lua,1); /* Discard field name pushed before. */ + /* Handle map reply. */ lua_pushstring(lua,"map"); lua_gettable(lua,-2);