Merge branch 'master' into multi-process

This commit is contained in:
wangbin579 2018-07-03 10:09:55 +08:00
commit 323f1e46f9
3 changed files with 20 additions and 0 deletions

View File

@ -132,6 +132,11 @@ NETWORK_MYSQLD_PLUGIN_PROTO(server_read_auth) {
send_sock = con->client;
packet.data = g_queue_peek_head(recv_sock->recv_queue->chunks);
if (packet.data == NULL) {
g_critical("%s: packet.data is nil", G_STRLOC);
return NETWORK_SOCKET_ERROR;
}
packet.offset = 0;
/* decode the packet */

View File

@ -1234,6 +1234,13 @@ network_read_query(network_mysqld_con *con, proxy_plugin_con_t *st)
network_packet packet;
GQueue *recv_queue = con->client->recv_queue->chunks;
packet.data = g_queue_peek_head(recv_queue);
if (packet.data == NULL) {
g_critical("%s: chunk is null", G_STRLOC);
network_mysqld_con_send_error(con->client, C("(proxy) unable to retrieve command"));
return PROXY_SEND_RESULT;
}
packet.offset = 0;
mysqld_query_attr_t query_attr = { 0 };

View File

@ -204,6 +204,14 @@ NETWORK_MYSQLD_PLUGIN_PROTO(proxy_read_query)
GQueue *chunks = con->client->recv_queue->chunks;
network_packet p;
p.data = g_queue_peek_head(chunks);
if (p.data == NULL) {
g_critical("%s: packet data is nil", G_STRLOC);
network_mysqld_con_send_error(con->client, C("(proxy) unable to process command"));
con->state = ST_SEND_QUERY_RESULT;
network_mysqld_queue_reset(con->client);
return NETWORK_SOCKET_SUCCESS;
}
p.offset = 0;
network_mysqld_con_reset_command_response_state(con);
g_debug("%s: call network_mysqld_con_command_states_init", G_STRLOC);