Added session timeouts.
The parameter 'connection_timeout' for services takes a value as seconds. All sessions that have been idle for longer than this will be disconnected.
This commit is contained in:
@ -31,7 +31,7 @@
|
||||
*/
|
||||
#include <dcb.h>
|
||||
#include <spinlock.h>
|
||||
|
||||
#include <housekeeper.h>
|
||||
/**
|
||||
* The telnetd specific protocol structure to put in the DCB.
|
||||
*/
|
||||
|
@ -61,6 +61,7 @@
|
||||
#include <users.h>
|
||||
#include <dbusers.h>
|
||||
#include <version.h>
|
||||
#include <housekeeper.h>
|
||||
|
||||
#define GW_MYSQL_VERSION "MaxScale " MAXSCALE_VERSION
|
||||
#define GW_MYSQL_LOOP_TIMEOUT 300000000
|
||||
|
@ -30,7 +30,7 @@
|
||||
* @endverbatim
|
||||
*/
|
||||
#include <dcb.h>
|
||||
|
||||
#include <housekeeper.h>
|
||||
/**
|
||||
* The telnetd specific protocol structure to put in the DCB.
|
||||
*/
|
||||
|
@ -144,6 +144,9 @@ char *password;
|
||||
|
||||
if ((n = dcb_read(dcb, &head)) != -1)
|
||||
{
|
||||
|
||||
dcb->last_read = hkheartbeat;
|
||||
|
||||
if (head)
|
||||
{
|
||||
unsigned char *ptr = GWBUF_DATA(head);
|
||||
|
@ -448,6 +448,8 @@ static int gw_read_backend_event(DCB *dcb) {
|
||||
/* read available backend data */
|
||||
rc = dcb_read(dcb, &read_buffer);
|
||||
|
||||
dcb->last_read = hkheartbeat;
|
||||
|
||||
if (rc < 0)
|
||||
{
|
||||
GWBUF* errbuf;
|
||||
|
@ -576,6 +576,8 @@ int gw_read_client_event(
|
||||
CHK_PROTOCOL(protocol);
|
||||
rc = dcb_read(dcb, &read_buffer);
|
||||
|
||||
dcb->last_read = hkheartbeat;
|
||||
|
||||
if (rc < 0)
|
||||
{
|
||||
dcb_close(dcb);
|
||||
|
@ -170,6 +170,9 @@ int gw_read_backend_handshake(
|
||||
|
||||
if ((n = dcb_read(dcb, &head)) != -1)
|
||||
{
|
||||
|
||||
dcb->last_read = hkheartbeat;
|
||||
|
||||
if (head)
|
||||
{
|
||||
payload = GWBUF_DATA(head);
|
||||
@ -420,6 +423,8 @@ int gw_receive_backend_auth(
|
||||
|
||||
n = dcb_read(dcb, &head);
|
||||
|
||||
dcb->last_read = hkheartbeat;
|
||||
|
||||
/*<
|
||||
* Read didn't fail and there is enough data for mysql packet.
|
||||
*/
|
||||
|
@ -156,6 +156,9 @@ char *password, *t;
|
||||
|
||||
if ((n = dcb_read(dcb, &head)) != -1)
|
||||
{
|
||||
|
||||
dcb->last_read = hkheartbeat;
|
||||
|
||||
if (head)
|
||||
{
|
||||
unsigned char *ptr = GWBUF_DATA(head);
|
||||
|
Reference in New Issue
Block a user