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
dd2f695d
Commit
dd2f695d
authored
Sep 18, 2019
by
antirez
Browse files
RESP3: Use verbatim in CLUSTER subcommands.
parent
1b3cb3b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
dd2f695d
...
@@ -4252,7 +4252,9 @@ NULL
...
@@ -4252,7 +4252,9 @@ NULL
}
}
} else if (!strcasecmp(c->argv[1]->ptr,"nodes") && c->argc == 2) {
} else if (!strcasecmp(c->argv[1]->ptr,"nodes") && c->argc == 2) {
/* CLUSTER NODES */
/* CLUSTER NODES */
addReplyBulkSds
(
c
,
clusterGenNodesDescription
(
0
));
sds nodes = clusterGenNodesDescription(0);
addReplyVerbatim(c,nodes,sdslen(nodes),"txt");
sdsfree(nodes);
} else if (!strcasecmp(c->argv[1]->ptr,"myid") && c->argc == 2) {
} else if (!strcasecmp(c->argv[1]->ptr,"myid") && c->argc == 2) {
/* CLUSTER MYID */
/* CLUSTER MYID */
addReplyBulkCBuffer(c,myself->name, CLUSTER_NAMELEN);
addReplyBulkCBuffer(c,myself->name, CLUSTER_NAMELEN);
...
@@ -4494,10 +4496,8 @@ NULL
...
@@ -4494,10 +4496,8 @@ NULL
"cluster_stats_messages_received:%lld\r\n", tot_msg_received);
"cluster_stats_messages_received:%lld\r\n", tot_msg_received);
/* Produce the reply protocol. */
/* Produce the reply protocol. */
addReplySds
(
c
,
sdscatprintf
(
sdsempty
(),
"$%lu
\r\n
"
,
addReplyVerbatim(c,info,sdslen(info),"txt");
(
unsigned
long
)
sdslen
(
info
)));
sdsfree(info);
addReplySds
(
c
,
info
);
addReply
(
c
,
shared
.
crlf
);
} else if (!strcasecmp(c->argv[1]->ptr,"saveconfig") && c->argc == 2) {
} else if (!strcasecmp(c->argv[1]->ptr,"saveconfig") && c->argc == 2) {
int retval = clusterSaveConfig(1);
int retval = clusterSaveConfig(1);
...
...
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