Only close valid sessions

When a session is being closed, the state needs to be checked. If the
session creation failed, the session need to be only freed.
This commit is contained in:
Markus Mäkelä
2017-05-16 09:35:27 +03:00
parent 39ca791a49
commit 17ba824d9f
3 changed files with 31 additions and 21 deletions

View File

@ -383,7 +383,7 @@ extern uint8_t null_client_sha1[MYSQL_SCRAMBLE_LEN];
MYSQL_session* mysql_session_alloc();
MySQLProtocol* mysql_protocol_init(DCB* dcb, int fd);
void mysql_protocol_done (DCB* dcb);
bool mysql_protocol_done (DCB* dcb);
const char *gw_mysql_protocol_state2string(int state);
int mysql_send_com_quit(DCB* dcb, int packet_number, GWBUF* buf);
GWBUF* mysql_create_com_quit(GWBUF* bufparam, int packet_number);