Throw away poll events that occur for persistent pool DCBs with no related session; fix typos.
This commit is contained in:
@ -656,6 +656,7 @@ char *user;
|
||||
LOGIF(LD, (skygw_log_write(
|
||||
LOGFILE_DEBUG,
|
||||
"%lu [dcb_connect] Reusing a persistent connection, dcb %p\n", pthread_self(), dcb)));
|
||||
dcb->persistentstart = 0;
|
||||
return dcb;
|
||||
}
|
||||
}
|
||||
@ -1298,12 +1299,15 @@ dcb_close(DCB *dcb)
|
||||
STRDCBSTATE(dcb->state))));
|
||||
|
||||
dcb_close_finish(dcb);
|
||||
atomic_add(&dcb->server->stats.n_current, -1);
|
||||
}
|
||||
}
|
||||
if (dcb->server) atomic_add(&dcb->server->stats.n_current, -1);
|
||||
ss_dassert(dcb->state == DCB_STATE_NOPOLLING ||
|
||||
dcb->state == DCB_STATE_ZOMBIE);
|
||||
}
|
||||
ss_dassert(dcb->state == DCB_STATE_NOPOLLING ||
|
||||
dcb->state == DCB_STATE_ZOMBIE ||
|
||||
dcb->state == DCB_STATE_POLLING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -153,7 +153,7 @@ server_get_persistent(SERVER *server, char *user, const char *protocol)
|
||||
spinlock_acquire(&server->persistlock);
|
||||
dcb = server->persistent;
|
||||
while (dcb) {
|
||||
if (dcb->user && dcb->protoname && 0 == strcmp(dcb->user, user) && 0 == strcmp(dcb->protoname, protocol))
|
||||
if (dcb->user && dcb->protoname && !dcb-> dcb_errhandle_called && 0 == strcmp(dcb->user, user) && 0 == strcmp(dcb->protoname, protocol))
|
||||
{
|
||||
if (NULL == previous)
|
||||
{
|
||||
|
@ -166,6 +166,11 @@ static int gw_read_backend_event(DCB *dcb) {
|
||||
int rc = 0;
|
||||
|
||||
CHK_DCB(dcb);
|
||||
if (!dcb->session && dcb->persistentstart)
|
||||
{
|
||||
dcb->dcb_errhandle_called = true;
|
||||
goto return_rc;
|
||||
}
|
||||
CHK_SESSION(dcb->session);
|
||||
|
||||
/*< return only with complete session */
|
||||
@ -1043,6 +1048,11 @@ gw_backend_hangup(DCB *dcb)
|
||||
session_state_t ses_state;
|
||||
|
||||
CHK_DCB(dcb);
|
||||
if (!dcb->session && dcb->persistentstart)
|
||||
{
|
||||
dcb->dcb_errhandle_called = true;
|
||||
goto retblock;
|
||||
}
|
||||
session = dcb->session;
|
||||
CHK_SESSION(session);
|
||||
|
||||
|
@ -1319,7 +1319,7 @@ int gw_check_mysql_scramble_data(DCB *dcb, uint8_t *token, unsigned int token_le
|
||||
|
||||
if (ret_val) {
|
||||
/* if password was sent, fill stage1_hash with at least 1 byte in order
|
||||
* to create rigth error message: (using password: YES|NO)
|
||||
* to create right error message: (using password: YES|NO)
|
||||
*/
|
||||
if (token_len)
|
||||
memcpy(stage1_hash, (char *)"_", 1);
|
||||
@ -1362,7 +1362,7 @@ int gw_check_mysql_scramble_data(DCB *dcb, uint8_t *token, unsigned int token_le
|
||||
/*<
|
||||
* step2: STEP2 = XOR(token, STEP1)
|
||||
*
|
||||
* token is trasmitted form client and it's based on the handshake scramble and SHA1(real_passowrd)
|
||||
* token is transmitted form client and it's based on the handshake scramble and SHA1(real_passowrd)
|
||||
* step1 has been computed in the previous step
|
||||
* the result STEP2 is SHA1(the_password_to_check) and is SHA_DIGEST_LENGTH long
|
||||
*/
|
||||
|
Reference in New Issue
Block a user