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
hiredis
Commits
e7e12ade
Commit
e7e12ade
authored
Jul 05, 2011
by
Pieter Noordhuis
Browse files
Indentation
parent
bd96d1f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
parser.c
View file @
e7e12ade
...
...
@@ -358,29 +358,29 @@ size_t redis_parser_execute(redis_parser_t *parser, redis_protocol_t **dst, cons
/* Transitions should be made from within the switch */
assert
(
NULL
&&
"invalid code path"
);
done:
/* Message is done when root object is done */
while
(
stackidx
>=
0
)
{
/* Move to nested object when we see an incomplete array */
cur
=
&
stack
[
stackidx
];
if
(
cur
->
type
==
REDIS_ARRAY_T
&&
cur
->
remaining
)
{
RESET_PROTOCOL_T
(
&
stack
[
++
stackidx
]);
cur
->
remaining
--
;
break
;
}
/* Aggregate plen for nested objects */
if
(
stackidx
>
0
)
{
stack
[
stackidx
-
1
].
plen
+=
cur
->
plen
;
}
done:
/* Message is done when root object is done */
while
(
stackidx
>=
0
)
{
/* Move to nested object when we see an incomplete array */
cur
=
&
stack
[
stackidx
];
if
(
cur
->
type
==
REDIS_ARRAY_T
&&
cur
->
remaining
)
{
RESET_PROTOCOL_T
(
&
stack
[
++
stackidx
]);
cur
->
remaining
--
;
break
;
}
stackidx
--
;
/* Aggregate plen for nested objects */
if
(
stackidx
>
0
)
{
stack
[
stackidx
-
1
].
plen
+=
cur
->
plen
;
}
/* Always move back to start state */
state
=
s_type_char
;
pos
++
;
nread
++
;
continue
;
stackidx
--
;
}
/* Always move back to start state */
state
=
s_type_char
;
pos
++
;
nread
++
;
continue
;
}
/* Set destination pointer when full message was read */
...
...
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