mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
RESP3: allow HELLO to be used with version = 2.
This commit is contained in:
parent
36d1588215
commit
3b420034bb
@ -2034,13 +2034,6 @@ void helloCommand(client *c) {
|
||||
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. */
|
||||
if (!c->authenticated) {
|
||||
addReplyError(c,"-NOAUTH HELLO must be called with the client already "
|
||||
@ -2050,8 +2043,8 @@ void helloCommand(client *c) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Let's switch to RESP3 mode. */
|
||||
c->resp = 3;
|
||||
/* Let's switch to the specified RESP mode. */
|
||||
c->resp = ver;
|
||||
addReplyMapLen(c,7);
|
||||
|
||||
addReplyBulkCString(c,"server");
|
||||
|
@ -1737,6 +1737,7 @@ void ACLInit(void);
|
||||
#define ACL_DENIED_CMD 1
|
||||
#define ACL_DENIED_KEY 2
|
||||
int ACLCheckUserCredentials(robj *username, robj *password);
|
||||
int ACLAuthenticateUser(client *c, robj *username, robj *password);
|
||||
unsigned long ACLGetCommandID(const char *cmdname);
|
||||
user *ACLGetUserByName(const char *name, size_t namelen);
|
||||
int ACLCheckCommandPerm(client *c);
|
||||
|
Loading…
Reference in New Issue
Block a user