ACL: avoid a radix tree lookup for the default user.

This commit is contained in:
antirez 2019-01-11 11:32:41 +01:00
parent 7f8314760a
commit aced0328e3
2 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,7 @@ client *createClient(int fd) {
c->argc = 0; c->argc = 0;
c->argv = NULL; c->argv = NULL;
c->cmd = c->lastcmd = NULL; c->cmd = c->lastcmd = NULL;
c->user = ACLGetUserByName("default",7); c->user = DefaultUser;
c->multibulklen = 0; c->multibulklen = 0;
c->bulklen = -1; c->bulklen = -1;
c->sentlen = 0; c->sentlen = 0;

View File

@ -1685,6 +1685,7 @@ void sendChildInfo(int process_type);
void receiveChildInfo(void); void receiveChildInfo(void);
/* acl.c -- Authentication related prototypes. */ /* acl.c -- Authentication related prototypes. */
extern user *DefaultUser;
void ACLInit(void); void ACLInit(void);
int ACLCheckUserCredentials(robj *username, robj *password); int ACLCheckUserCredentials(robj *username, robj *password);
unsigned long ACLGetCommandID(const char *cmdname); unsigned long ACLGetCommandID(const char *cmdname);