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
10a6da7a
Commit
10a6da7a
authored
May 01, 2011
by
antirez
Browse files
Multi bulk to Lua table now working
parent
3791000f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scripting.c
View file @
10a6da7a
...
@@ -98,17 +98,15 @@ char *redisProtocolToLuaType_MultiBulk(lua_State *lua, char *reply) {
...
@@ -98,17 +98,15 @@ char *redisProtocolToLuaType_MultiBulk(lua_State *lua, char *reply) {
long
long
mbulklen
;
long
long
mbulklen
;
int
j
=
0
;
int
j
=
0
;
printf
(
"--%s-- (%d)
\n
"
,
reply
,(
int
)(
p
-
reply
-
1
));
string2ll
(
reply
+
1
,
p
-
reply
-
1
,
&
mbulklen
);
string2ll
(
reply
+
1
,
p
-
reply
-
1
,
&
mbulklen
);
p
+=
2
;
p
+=
2
;
if
(
mbulklen
==
-
1
)
{
if
(
mbulklen
==
-
1
)
{
lua_pushnil
(
lua
);
lua_pushnil
(
lua
);
return
p
;
return
p
;
}
}
printf
(
"BL: %lld
\n
"
,
mbulklen
);
lua_newtable
(
lua
);
lua_newtable
(
lua
);
for
(
j
=
0
;
j
<
mbulklen
;
j
++
)
{
for
(
j
=
0
;
j
<
mbulklen
;
j
++
)
{
lua_pushnumber
(
lua
,
j
);
lua_pushnumber
(
lua
,
j
+
1
);
p
=
redisProtocolToLuaType
(
lua
,
p
);
p
=
redisProtocolToLuaType
(
lua
,
p
);
lua_settable
(
lua
,
-
3
);
lua_settable
(
lua
,
-
3
);
}
}
...
...
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