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
e14aabf9
Commit
e14aabf9
authored
Nov 21, 2018
by
antirez
Browse files
RESP3: addReply*Len() support for RESP2 backward comp.
parent
1ac69266
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
e14aabf9
...
...
@@ -562,23 +562,23 @@ void addReplyArrayLen(client *c, long length) {
}
void
addReplyMapLen
(
client
*
c
,
long
length
)
{
addReplyAggregateLen
(
c
,
length
,
'%'
);
int
prefix
=
c
->
resp
==
2
?
'*'
:
'%'
;
addReplyAggregateLen
(
c
,
length
,
prefix
);
}
void
addReplySetLen
(
client
*
c
,
long
length
)
{
addReplyAggregateLen
(
c
,
length
,
'~'
);
int
prefix
=
c
->
resp
==
2
?
'*'
:
'~'
;
addReplyAggregateLen
(
c
,
length
,
prefix
);
}
void
addReplyAttributeLen
(
client
*
c
,
long
length
)
{
addReplyAggregateLen
(
c
,
length
,
'|'
);
int
prefix
=
c
->
resp
==
2
?
'*'
:
'|'
;
addReplyAggregateLen
(
c
,
length
,
prefix
);
}
void
addReplyPushLen
(
client
*
c
,
long
length
)
{
addReplyAggregateLen
(
c
,
length
,
'>'
);
}
void
addReplyHelloLen
(
client
*
c
,
long
length
)
{
addReplyAggregateLen
(
c
,
length
,
'@'
);
int
prefix
=
c
->
resp
==
2
?
'*'
:
'>'
;
addReplyAggregateLen
(
c
,
length
,
prefix
);
}
/* Create the length prefix of a bulk reply, example: $2234 */
...
...
src/server.h
View file @
e14aabf9
...
...
@@ -1456,7 +1456,6 @@ void addReplyMapLen(client *c, long length);
void
addReplySetLen
(
client
*
c
,
long
length
);
void
addReplyAttributeLen
(
client
*
c
,
long
length
);
void
addReplyPushLen
(
client
*
c
,
long
length
);
void
addReplyHelloLen
(
client
*
c
,
long
length
);
void
addReplyHelp
(
client
*
c
,
const
char
**
help
);
void
addReplySubcommandSyntaxError
(
client
*
c
);
void
copyClientOutputBuffer
(
client
*
dst
,
client
*
src
);
...
...
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