Small bug fix and optimization

myhash in Standard_MySQL_Authentication::lookup
pull/248/head
René Cannaò 11 years ago
parent 6632ee979f
commit 9594b42aef

@ -1357,7 +1357,7 @@ void MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
client_myds->myprot.generate_pkt_OK(true,NULL,NULL,1,0,0,0,0,NULL);
client_myds->DSS=STATE_SLEEP;
status=WAITING_CLIENT_DATA;
wrong_pass=false;
*wrong_pass=false;
} else {
l_free(pkt->size,pkt->ptr);
proxy_debug(PROXY_DEBUG_MYSQL_CONNECTION, 5, "Wrong credentials for frontend: disconnecting\n");

@ -137,11 +137,10 @@ class Standard_MySQL_Authentication: public MySQL_Authentication {
virtual char * lookup(char * username, enum cred_username_type usertype, bool *use_ssl, int *default_hostgroup, bool *transaction_persistent) {
char *ret=NULL;
uint64_t hash1, hash2;
SpookyHash *myhash=new SpookyHash();
myhash->Init(1,2);
myhash->Update(username,strlen(username));
myhash->Final(&hash1,&hash2);
delete myhash;
SpookyHash myhash;
myhash.Init(1,2);
myhash.Update(username,strlen(username));
myhash.Final(&hash1,&hash2);
creds_group_t &cg=(usertype==USERNAME_BACKEND ? creds_backends : creds_frontends);

Loading…
Cancel
Save