mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -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;
|
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) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Let's switch to RESP3 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");
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user