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
3b420034
Commit
3b420034
authored
Feb 25, 2019
by
antirez
Browse files
RESP3: allow HELLO to be used with version = 2.
parent
36d15882
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
3b420034
...
@@ -2034,13 +2034,6 @@ void helloCommand(client *c) {
...
@@ -2034,13 +2034,6 @@ void helloCommand(client *c) {
return
;
return
;
}
}
/* Switching to protocol v2 is not allowed. But we send a specific
* error message in this case. */
if
(
ver
==
2
)
{
addReplyError
(
c
,
"Switching to RESP version 2 is not allowed."
);
return
;
}
/* At this point we need to be authenticated to continue. */
/* At this point we need to be authenticated to continue. */
if
(
!
c
->
authenticated
)
{
if
(
!
c
->
authenticated
)
{
addReplyError
(
c
,
"-NOAUTH HELLO must be called with the client already "
addReplyError
(
c
,
"-NOAUTH HELLO must be called with the client already "
...
@@ -2050,8 +2043,8 @@ void helloCommand(client *c) {
...
@@ -2050,8 +2043,8 @@ void helloCommand(client *c) {
return
;
return
;
}
}
/* Let's switch to RESP
3
mode. */
/* Let's switch to
the specified
RESP mode. */
c
->
resp
=
3
;
c
->
resp
=
ver
;
addReplyMapLen
(
c
,
7
);
addReplyMapLen
(
c
,
7
);
addReplyBulkCString
(
c
,
"server"
);
addReplyBulkCString
(
c
,
"server"
);
...
...
src/server.h
View file @
3b420034
...
@@ -1737,6 +1737,7 @@ void ACLInit(void);
...
@@ -1737,6 +1737,7 @@ void ACLInit(void);
#define ACL_DENIED_CMD 1
#define ACL_DENIED_CMD 1
#define ACL_DENIED_KEY 2
#define ACL_DENIED_KEY 2
int
ACLCheckUserCredentials
(
robj
*
username
,
robj
*
password
);
int
ACLCheckUserCredentials
(
robj
*
username
,
robj
*
password
);
int
ACLAuthenticateUser
(
client
*
c
,
robj
*
username
,
robj
*
password
);
unsigned
long
ACLGetCommandID
(
const
char
*
cmdname
);
unsigned
long
ACLGetCommandID
(
const
char
*
cmdname
);
user
*
ACLGetUserByName
(
const
char
*
name
,
size_t
namelen
);
user
*
ACLGetUserByName
(
const
char
*
name
,
size_t
namelen
);
int
ACLCheckCommandPerm
(
client
*
c
);
int
ACLCheckCommandPerm
(
client
*
c
);
...
...
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