Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ca81d490
Commit
ca81d490
authored
Sep 16, 2019
by
antirez
Browse files
RESP3: handle set Lua -> Redis conversion.
parent
c792504f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scripting.c
View file @
ca81d490
...
@@ -368,6 +368,28 @@ void luaReplyToRedisReply(client *c, lua_State *lua) {
...
@@ -368,6 +368,28 @@ void luaReplyToRedisReply(client *c, lua_State *lua) {
}
}
lua_pop(lua,1); /* Discard field name pushed before. */
lua_pop(lua,1); /* Discard field name pushed before. */
/* Handle set reply. */
lua_pushstring(lua,"set");
lua_gettable(lua,-2);
t = lua_type(lua,-1);
if (t == LUA_TTABLE) {
int setlen = 0;
void *replylen = addReplyDeferredLen(c);
lua_pushnil(lua); /* Use nil to start iteration. */
while (lua_next(lua,-2)) {
/* Stack now: table, key, true */
lua_pop(lua,1); /* Discard the boolean value. */
lua_pushvalue(lua,-1); /* Dup key before consuming. */
luaReplyToRedisReply(c, lua); /* Return key. */
/* Stack now: table, key. */
setlen++;
}
setDeferredSetLen(c,replylen,setlen);
lua_pop(lua,2);
return;
}
lua_pop(lua,1); /* Discard field name pushed before. */
/* Handle the array reply. */
/* Handle the array reply. */
void *replylen = addReplyDeferredLen(c);
void *replylen = addReplyDeferredLen(c);
int j = 1, mbulklen = 0;
int j = 1, mbulklen = 0;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment