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
1b7298e6
Commit
1b7298e6
authored
Nov 27, 2018
by
antirez
Browse files
RESP3: addReplyNull() added.
parent
fc9a3de9
Changes
3
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
1b7298e6
...
@@ -603,6 +603,14 @@ void addReplyPushLen(client *c, long length) {
...
@@ -603,6 +603,14 @@ void addReplyPushLen(client *c, long length) {
addReplyAggregateLen
(
c
,
length
,
prefix
);
addReplyAggregateLen
(
c
,
length
,
prefix
);
}
}
void
addReplyNull
(
client
*
c
)
{
if
(
c
->
resp
==
2
)
{
addReplyString
(
c
,
"$-1
\r\n
"
,
5
);
}
else
{
addReplyString
(
c
,
"_
\r\n
"
,
3
);
}
}
/* Create the length prefix of a bulk reply, example: $2234 */
/* Create the length prefix of a bulk reply, example: $2234 */
void
addReplyBulkLen
(
client
*
c
,
robj
*
obj
)
{
void
addReplyBulkLen
(
client
*
c
,
robj
*
obj
)
{
size_t
len
;
size_t
len
;
...
...
src/server.c
View file @
1b7298e6
...
@@ -2954,7 +2954,7 @@ int addReplyCommandFlag(client *c, struct redisCommand *cmd, int f, char *reply)
...
@@ -2954,7 +2954,7 @@ int addReplyCommandFlag(client *c, struct redisCommand *cmd, int f, char *reply)
/* Output the representation of a Redis command. Used by the COMMAND command. */
/* Output the representation of a Redis command. Used by the COMMAND command. */
void
addReplyCommand
(
client
*
c
,
struct
redisCommand
*
cmd
)
{
void
addReplyCommand
(
client
*
c
,
struct
redisCommand
*
cmd
)
{
if
(
!
cmd
)
{
if
(
!
cmd
)
{
addReply
(
c
,
shared
.
nullbulk
);
addReply
Null
(
c
);
}
else
{
}
else
{
/* We are adding: command name, arg count, flags, first, last, offset */
/* We are adding: command name, arg count, flags, first, last, offset */
addReplyArrayLen
(
c
,
6
);
addReplyArrayLen
(
c
,
6
);
...
...
src/server.h
View file @
1b7298e6
...
@@ -1437,6 +1437,7 @@ void acceptHandler(aeEventLoop *el, int fd, void *privdata, int mask);
...
@@ -1437,6 +1437,7 @@ void acceptHandler(aeEventLoop *el, int fd, void *privdata, int mask);
void
acceptTcpHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
acceptTcpHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
acceptUnixHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
acceptUnixHandler
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
readQueryFromClient
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
readQueryFromClient
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
);
void
addReplyNull
(
client
*
c
);
void
addReplyString
(
client
*
c
,
const
char
*
s
,
size_t
len
);
void
addReplyString
(
client
*
c
,
const
char
*
s
,
size_t
len
);
void
addReplyBulk
(
client
*
c
,
robj
*
obj
);
void
addReplyBulk
(
client
*
c
,
robj
*
obj
);
void
addReplyBulkCString
(
client
*
c
,
const
char
*
s
);
void
addReplyBulkCString
(
client
*
c
,
const
char
*
s
);
...
...
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