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
2e8f8c9b
Commit
2e8f8c9b
authored
Dec 24, 2020
by
xhe
Browse files
HELLO without protover
Signed-off-by:
xhe
<
xw897002528@gmail.com
>
parent
b3dc23c5
Changes
3
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
2e8f8c9b
...
@@ -2758,18 +2758,17 @@ NULL
...
@@ -2758,18 +2758,17 @@ NULL
}
}
}
}
/* HELLO
<
protocol-version
>
[AUTH <user> <password>] [SETNAME <name>] */
/* HELLO
[
protocol-version
]
[AUTH <user> <password>] [SETNAME <name>] */
void helloCommand(client *c) {
void helloCommand(client *c) {
long
long
ver
;
long long ver
= 0
;
if
(
getLongLongFromObject
(
c
->
argv
[
1
],
&
ver
)
!=
C_OK
||
if (c->argc >= 2 && getLongLongFromObject(c->argv[1],&ver) == C_OK &&
(
ver
!=
0
&&
ver
<
2
)
||
ver
>
3
)
(ver < 2 || ver > 3)) {
{
addReplyError(c,"-NOPROTO unsupported protocol version");
addReplyError(c,"-NOPROTO unsupported protocol version");
return;
return;
}
}
for
(
int
j
=
2
;
j
<
c
->
argc
;
j
++
)
{
for (int j =
ver == 0 ? 1 :
2; j < c->argc; j++) {
int moreargs = (c->argc-1) - j;
int moreargs = (c->argc-1) - j;
const char *opt = c->argv[j]->ptr;
const char *opt = c->argv[j]->ptr;
if (!strcasecmp(opt,"AUTH") && moreargs >= 2) {
if (!strcasecmp(opt,"AUTH") && moreargs >= 2) {
...
...
src/sentinel.c
View file @
2e8f8c9b
...
@@ -469,7 +469,7 @@ struct redisCommand sentinelcmds[] = {
...
@@ -469,7 +469,7 @@ struct redisCommand sentinelcmds[] = {
{
"client"
,
clientCommand
,
-
2
,
"admin random @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"client"
,
clientCommand
,
-
2
,
"admin random @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"shutdown"
,
shutdownCommand
,
-
1
,
"admin"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"shutdown"
,
shutdownCommand
,
-
1
,
"admin"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"auth"
,
authCommand
,
-
2
,
"no-auth fast @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"auth"
,
authCommand
,
-
2
,
"no-auth fast @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"hello"
,
helloCommand
,
-
2
,
"no-auth fast @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"hello"
,
helloCommand
,
-
1
,
"no-auth fast @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
},
{
"acl"
,
aclCommand
,
-
2
,
"admin"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"acl"
,
aclCommand
,
-
2
,
"admin"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"command"
,
commandCommand
,
-
1
,
"random @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
}
{
"command"
,
commandCommand
,
-
1
,
"random @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
}
};
};
...
...
src/server.c
View file @
2e8f8c9b
...
@@ -869,7 +869,7 @@ struct redisCommand redisCommandTable[] = {
...
@@ -869,7 +869,7 @@ struct redisCommand redisCommandTable[] = {
"admin no-script random ok-loading ok-stale @connection"
,
"admin no-script random ok-loading ok-stale @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"hello"
,
helloCommand
,
-
2
,
{
"hello"
,
helloCommand
,
-
1
,
"no-auth no-script fast no-monitor ok-loading ok-stale no-slowlog @connection"
,
"no-auth no-script fast no-monitor ok-loading ok-stale no-slowlog @connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
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