mirror of
https://gitee.com/wangbin579/cetus.git
synced 2024-12-02 11:57:44 +08:00
Merge pull request #88 from wangbin579/master
Add read timeout processing for admin
This commit is contained in:
commit
e8b9e7fdd5
@ -2506,6 +2506,19 @@ NETWORK_MYSQLD_PLUGIN_PROTO(server_read_query)
|
||||
return NETWORK_SOCKET_SUCCESS;
|
||||
}
|
||||
|
||||
NETWORK_MYSQLD_PLUGIN_PROTO(proxy_timeout)
|
||||
{
|
||||
int diff = con->srv->current_time - con->client->update_time;
|
||||
|
||||
if (diff >= con->srv->client_idle_timeout) {
|
||||
con->prev_state = con->state;
|
||||
con->state = ST_SEND_ERROR;
|
||||
}
|
||||
|
||||
return NETWORK_SOCKET_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* cleanup the admin specific data on the current connection
|
||||
*
|
||||
@ -2528,6 +2541,8 @@ network_mysqld_server_connection_init(network_mysqld_con *con)
|
||||
|
||||
con->plugins.con_read_query = server_read_query;
|
||||
|
||||
con->plugins.con_timeout = proxy_timeout;
|
||||
|
||||
con->plugins.con_cleanup = admin_disconnect_client;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user