Rename UPSTREAM to MXS_UPSTREAM
And DOWNSTREAM to MXS_DOWNSTREAM
This commit is contained in:
parent
356690c0e5
commit
424849a9a2
@ -72,8 +72,8 @@ typedef struct mxs_filter_object
|
||||
MXS_FILTER_SESSION *(*newSession)(MXS_FILTER *instance, SESSION *session);
|
||||
void (*closeSession)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession);
|
||||
void (*freeSession)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession);
|
||||
void (*setDownstream)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
void (*setUpstream)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *downstream);
|
||||
void (*setDownstream)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
void (*setUpstream)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *downstream);
|
||||
int32_t (*routeQuery)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
int32_t (*clientReply)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
void (*diagnostics)(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
m_data.routeQuery = NULL;
|
||||
}
|
||||
|
||||
Downstream(const DOWNSTREAM& down)
|
||||
Downstream(const MXS_DOWNSTREAM& down)
|
||||
: m_data(down)
|
||||
{}
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
return m_data.routeQuery(m_data.instance, m_data.session, pPacket);
|
||||
}
|
||||
|
||||
DOWNSTREAM m_data;
|
||||
MXS_DOWNSTREAM m_data;
|
||||
};
|
||||
|
||||
class Upstream
|
||||
@ -81,7 +81,7 @@ public:
|
||||
m_data.clientReply = NULL;
|
||||
}
|
||||
|
||||
Upstream(const UPSTREAM& up)
|
||||
Upstream(const MXS_UPSTREAM& up)
|
||||
: m_data(up)
|
||||
{}
|
||||
|
||||
@ -98,7 +98,7 @@ public:
|
||||
return m_data.clientReply(m_data.instance, m_data.session, pPacket);
|
||||
}
|
||||
|
||||
UPSTREAM m_data;
|
||||
MXS_UPSTREAM m_data;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -236,7 +236,7 @@ public:
|
||||
MXS_EXCEPTION_GUARD(delete pFilterSession);
|
||||
}
|
||||
|
||||
static void setDownstream(MXS_FILTER*, MXS_FILTER_SESSION* pData, DOWNSTREAM* pDownstream)
|
||||
static void setDownstream(MXS_FILTER*, MXS_FILTER_SESSION* pData, MXS_DOWNSTREAM* pDownstream)
|
||||
{
|
||||
FilterSessionType* pFilterSession = reinterpret_cast<FilterSessionType*>(pData);
|
||||
|
||||
@ -245,7 +245,7 @@ public:
|
||||
MXS_EXCEPTION_GUARD(pFilterSession->setDownstream(down));
|
||||
}
|
||||
|
||||
static void setUpstream(MXS_FILTER* pInstance, MXS_FILTER_SESSION* pData, UPSTREAM* pUpstream)
|
||||
static void setUpstream(MXS_FILTER* pInstance, MXS_FILTER_SESSION* pData, MXS_UPSTREAM* pUpstream)
|
||||
{
|
||||
FilterSessionType* pFilterSession = reinterpret_cast<FilterSessionType*>(pData);
|
||||
|
||||
|
@ -103,28 +103,28 @@ const char* session_trx_state_to_string(session_trx_state_t state);
|
||||
* The downstream element in the filter chain. This may refer to
|
||||
* another filter or to a router.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct mxs_downstream
|
||||
{
|
||||
void *instance;
|
||||
void *session;
|
||||
int (*routeQuery)(void *instance, void *session, GWBUF *request);
|
||||
} DOWNSTREAM;
|
||||
int32_t (*routeQuery)(void *instance, void *session, GWBUF *request);
|
||||
} MXS_DOWNSTREAM;
|
||||
|
||||
#define DOWNSTREAM_INIT {0}
|
||||
#define MXS_DOWNSTREAM_INIT {0}
|
||||
|
||||
/**
|
||||
* The upstream element in the filter chain. This may refer to
|
||||
* another filter or to the protocol implementation.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct mxs_upstream
|
||||
{
|
||||
void *instance;
|
||||
void *session;
|
||||
int (*clientReply)(void *instance, void *session, GWBUF *response);
|
||||
int (*error)(void *instance, void *session, void *);
|
||||
} UPSTREAM;
|
||||
int32_t (*clientReply)(void *instance, void *session, GWBUF *response);
|
||||
int32_t (*error)(void *instance, void *session, void *);
|
||||
} MXS_UPSTREAM;
|
||||
|
||||
#define UPSTREAM_INIT {0}
|
||||
#define MXS_UPSTREAM_INIT {0}
|
||||
|
||||
/**
|
||||
* Structure used to track the filter instances and sessions of the filters
|
||||
@ -171,8 +171,8 @@ typedef struct session
|
||||
struct service *service; /*< The service this session is using */
|
||||
int n_filters; /*< Number of filter sessions */
|
||||
SESSION_FILTER *filters; /*< The filters in use within this session */
|
||||
DOWNSTREAM head; /*< Head of the filter chain */
|
||||
UPSTREAM tail; /*< The tail of the filter chain */
|
||||
MXS_DOWNSTREAM head; /*< Head of the filter chain */
|
||||
MXS_UPSTREAM tail; /*< The tail of the filter chain */
|
||||
int refcount; /*< Reference count on the session */
|
||||
bool ses_is_child; /*< this is a child session */
|
||||
session_trx_state_t trx_state; /*< The current transaction state. */
|
||||
@ -186,7 +186,7 @@ typedef struct session
|
||||
} SESSION;
|
||||
|
||||
#define SESSION_INIT {.ses_chk_top = CHK_NUM_SESSION, .ses_lock = SPINLOCK_INIT, \
|
||||
.stats = SESSION_STATS_INIT, .head = DOWNSTREAM_INIT, .tail = UPSTREAM_INIT, \
|
||||
.stats = SESSION_STATS_INIT, .head = MXS_DOWNSTREAM_INIT, .tail = MXS_UPSTREAM_INIT, \
|
||||
.state = SESSION_STATE_ALLOC, .ses_chk_tail = CHK_NUM_SESSION}
|
||||
|
||||
#define SESSION_PROTOCOL(x, type) DCB_PROTOCOL((x)->client_dcb, type)
|
||||
|
@ -66,6 +66,7 @@
|
||||
#include <maxscale/utils.h>
|
||||
#include <maxscale/gwdirs.h>
|
||||
|
||||
#include "maxscale/filter.h"
|
||||
#include "maxscale/service.h"
|
||||
|
||||
typedef struct duplicate_context
|
||||
|
@ -399,12 +399,12 @@ bool filter_load(FILTER_DEF* filter)
|
||||
* @return The downstream component for the next filter or NULL
|
||||
* if the filter could not be created
|
||||
*/
|
||||
DOWNSTREAM *
|
||||
filter_apply(FILTER_DEF *filter, SESSION *session, DOWNSTREAM *downstream)
|
||||
MXS_DOWNSTREAM *
|
||||
filter_apply(FILTER_DEF *filter, SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
DOWNSTREAM *me;
|
||||
MXS_DOWNSTREAM *me;
|
||||
|
||||
if ((me = (DOWNSTREAM *)MXS_CALLOC(1, sizeof(DOWNSTREAM))) == NULL)
|
||||
if ((me = (MXS_DOWNSTREAM *)MXS_CALLOC(1, sizeof(MXS_DOWNSTREAM))) == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -434,10 +434,10 @@ filter_apply(FILTER_DEF *filter, SESSION *session, DOWNSTREAM *downstream)
|
||||
* @param upstream The filter that should be upstream of this filter
|
||||
* @return The upstream component for the next filter
|
||||
*/
|
||||
UPSTREAM *
|
||||
filter_upstream(FILTER_DEF *filter, void *fsession, UPSTREAM *upstream)
|
||||
MXS_UPSTREAM *
|
||||
filter_upstream(FILTER_DEF *filter, void *fsession, MXS_UPSTREAM *upstream)
|
||||
{
|
||||
UPSTREAM *me = NULL;
|
||||
MXS_UPSTREAM *me = NULL;
|
||||
|
||||
/*
|
||||
* The the filter has no setUpstream entry point then is does
|
||||
@ -450,7 +450,7 @@ filter_upstream(FILTER_DEF *filter, void *fsession, UPSTREAM *upstream)
|
||||
|
||||
if (filter->obj->clientReply != NULL)
|
||||
{
|
||||
if ((me = (UPSTREAM *)MXS_CALLOC(1, sizeof(UPSTREAM))) == NULL)
|
||||
if ((me = (MXS_UPSTREAM *)MXS_CALLOC(1, sizeof(MXS_UPSTREAM))) == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -23,10 +23,10 @@ MXS_BEGIN_DECLS
|
||||
void filter_add_option(FILTER_DEF *filter_def, const char *option);
|
||||
void filter_add_parameter(FILTER_DEF *filter_def, const char *name, const char *value);
|
||||
FILTER_DEF *filter_alloc(const char *name, const char *module_name);
|
||||
DOWNSTREAM *filter_apply(FILTER_DEF *filte_def, SESSION *session, DOWNSTREAM *downstream);
|
||||
MXS_DOWNSTREAM *filter_apply(FILTER_DEF *filter_def, SESSION *session, MXS_DOWNSTREAM *downstream);
|
||||
void filter_free(FILTER_DEF *filter_def);
|
||||
bool filter_load(FILTER_DEF *filter_def);
|
||||
int filter_standard_parameter(const char *name);
|
||||
UPSTREAM *filter_upstream(FILTER_DEF *filter_def, void *fsession, UPSTREAM *upstream);
|
||||
MXS_UPSTREAM *filter_upstream(FILTER_DEF *filter_def, void *fsession, MXS_UPSTREAM *upstream);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
@ -627,8 +627,8 @@ static int
|
||||
session_setup_filters(SESSION *session)
|
||||
{
|
||||
SERVICE *service = session->service;
|
||||
DOWNSTREAM *head;
|
||||
UPSTREAM *tail;
|
||||
MXS_DOWNSTREAM *head;
|
||||
MXS_UPSTREAM *tail;
|
||||
int i;
|
||||
|
||||
if ((session->filters = MXS_CALLOC(service->n_filters,
|
||||
|
@ -50,7 +50,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARA
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
@ -86,9 +86,9 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
DOWNSTREAM down; /*< The downstream filter */
|
||||
int hints_left; /*< Number of hints left to add to queries*/
|
||||
time_t last_modification; /*< Time of the last data modifying operation */
|
||||
MXS_DOWNSTREAM down; /*< The downstream filter */
|
||||
int hints_left; /*< Number of hints left to add to queries*/
|
||||
time_t last_modification; /*< Time of the last data modifying operation */
|
||||
} CCR_SESSION;
|
||||
|
||||
/**
|
||||
@ -269,7 +269,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
CCR_SESSION *my_session = (CCR_SESSION *)session;
|
||||
|
||||
|
@ -98,7 +98,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
@ -260,11 +260,11 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
SESSION* session; /*< Client session structure */
|
||||
char* errmsg; /*< Rule specific error message */
|
||||
QUERYSPEED* query_speed; /*< How fast the user has executed queries */
|
||||
DOWNSTREAM down; /*< Next object in the downstream chain */
|
||||
UPSTREAM up; /*< Next object in the upstream chain */
|
||||
SESSION *session; /*< Client session structure */
|
||||
char *errmsg; /*< Rule specific error message */
|
||||
QUERYSPEED *query_speed; /*< How fast the user has executed queries */
|
||||
MXS_DOWNSTREAM down; /*< Next object in the downstream chain */
|
||||
MXS_UPSTREAM up; /*< Next object in the upstream chain */
|
||||
} FW_SESSION;
|
||||
|
||||
bool parse_at_times(const char** tok, char** saveptr, RULE* ruledef);
|
||||
@ -1638,7 +1638,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router.
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
FW_SESSION *my_session = (FW_SESSION *) session;
|
||||
my_session->down = *downstream;
|
||||
|
@ -27,7 +27,7 @@ static MXS_FILTER *createInstance(const char* name, char **options, CONFIG_PARAM
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
@ -176,7 +176,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
HINT_SESSION *my_session = (HINT_SESSION *)session;
|
||||
|
||||
|
@ -90,11 +90,11 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
DOWNSTREAM down;
|
||||
GWBUF *request;
|
||||
int query_len;
|
||||
HINTSTACK *stack;
|
||||
NAMEDHINTS *named_hints; /* The named hints defined in this session */
|
||||
MXS_DOWNSTREAM down;
|
||||
GWBUF *request;
|
||||
int query_len;
|
||||
HINTSTACK *stack;
|
||||
NAMEDHINTS *named_hints; /* The named hints defined in this session */
|
||||
} HINT_SESSION;
|
||||
|
||||
/* Some useful macros */
|
||||
|
@ -50,8 +50,8 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, UPSTREAM *upstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, MXS_DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, MXS_UPSTREAM *upstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, GWBUF *queue);
|
||||
static void diagnostics(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DCB *dcb);
|
||||
@ -153,14 +153,14 @@ static void maxrows_response_state_reset(MAXROWS_RESPONSE_STATE *state);
|
||||
|
||||
typedef struct maxrows_session_data
|
||||
{
|
||||
MAXROWS_INSTANCE *instance; /**< The maxrows instance the session is associated with. */
|
||||
DOWNSTREAM down; /**< The previous filter or equivalent. */
|
||||
UPSTREAM up; /**< The next filter or equivalent. */
|
||||
MAXROWS_RESPONSE_STATE res; /**< The response state. */
|
||||
SESSION *session; /**< The session this data is associated with. */
|
||||
MAXROWS_INSTANCE *instance; /**< The maxrows instance the session is associated with. */
|
||||
MXS_DOWNSTREAM down; /**< The previous filter or equivalent. */
|
||||
MXS_UPSTREAM up; /**< The next filter or equivalent. */
|
||||
MAXROWS_RESPONSE_STATE res; /**< The response state. */
|
||||
SESSION *session; /**< The session this data is associated with. */
|
||||
maxrows_session_state_t state;
|
||||
bool large_packet; /**< Large packet (> 16MB)) indicator */
|
||||
bool discard_resultset; /**< Discard resultset indicator */
|
||||
bool large_packet; /**< Large packet (> 16MB)) indicator */
|
||||
bool discard_resultset; /**< Discard resultset indicator */
|
||||
} MAXROWS_SESSION_DATA;
|
||||
|
||||
static MAXROWS_SESSION_DATA *maxrows_session_data_create(MAXROWS_INSTANCE *instance, SESSION *session);
|
||||
@ -252,7 +252,7 @@ static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata)
|
||||
* @param sdata The session data of the session
|
||||
* @param down The downstream filter or router
|
||||
*/
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DOWNSTREAM *down)
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, MXS_DOWNSTREAM *down)
|
||||
{
|
||||
MAXROWS_INSTANCE *cinstance = (MAXROWS_INSTANCE*)instance;
|
||||
MAXROWS_SESSION_DATA *csdata = (MAXROWS_SESSION_DATA*)sdata;
|
||||
@ -267,7 +267,7 @@ static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DOWNS
|
||||
* @param sdata The session data of the session
|
||||
* @param up The upstream filter or router
|
||||
*/
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, UPSTREAM *up)
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, MXS_UPSTREAM *up)
|
||||
{
|
||||
MAXROWS_INSTANCE *cinstance = (MAXROWS_INSTANCE*)instance;
|
||||
MAXROWS_SESSION_DATA *csdata = (MAXROWS_SESSION_DATA*)sdata;
|
||||
|
@ -87,8 +87,8 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *upstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *upstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
@ -229,8 +229,8 @@ typedef struct
|
||||
{
|
||||
char* uid; /**Unique identifier used to tag messages*/
|
||||
char* db; /**The currently active database*/
|
||||
DOWNSTREAM down;
|
||||
UPSTREAM up;
|
||||
MXS_DOWNSTREAM down;
|
||||
MXS_UPSTREAM up;
|
||||
SESSION* session;
|
||||
bool was_query; /**True if the previous routeQuery call had valid content*/
|
||||
} MQ_SESSION;
|
||||
@ -873,13 +873,13 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router.
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
MQ_SESSION *my_session = (MQ_SESSION *) session;
|
||||
my_session->down = *downstream;
|
||||
}
|
||||
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, UPSTREAM *upstream)
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_UPSTREAM *upstream)
|
||||
{
|
||||
MQ_SESSION *my_session = (MQ_SESSION *) session;
|
||||
my_session->up = *upstream;
|
||||
|
@ -44,7 +44,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
@ -66,7 +66,7 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
DOWNSTREAM down; /* The downstream filter */
|
||||
MXS_DOWNSTREAM down; /* The downstream filter */
|
||||
int n_diverted; /* No. of statements diverted */
|
||||
int n_undiverted; /* No. of statements not diverted */
|
||||
int active; /* Is filter active */
|
||||
@ -258,7 +258,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
REGEXHINT_SESSION *my_session = (REGEXHINT_SESSION *) session;
|
||||
my_session->down = *downstream;
|
||||
|
@ -77,7 +77,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
@ -121,7 +121,7 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
int active;
|
||||
DOWNSTREAM down;
|
||||
MXS_DOWNSTREAM down;
|
||||
char *filename; /* The session-specific log file name */
|
||||
FILE *fp; /* The session-specific log file */
|
||||
const char *remote;
|
||||
@ -483,7 +483,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router.
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
QLA_SESSION *my_session = (QLA_SESSION *) session;
|
||||
|
||||
|
@ -44,7 +44,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
@ -72,7 +72,7 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
DOWNSTREAM down; /* The downstream filter */
|
||||
MXS_DOWNSTREAM down; /* The downstream filter */
|
||||
SPINLOCK lock;
|
||||
int no_change; /* No. of unchanged requests */
|
||||
int replacements; /* No. of changed requests */
|
||||
@ -308,7 +308,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
REGEX_SESSION *my_session = (REGEX_SESSION *) session;
|
||||
my_session->down = *downstream;
|
||||
|
@ -101,8 +101,8 @@ static MXS_FILTER *createInstance(const char* name, char **options, CONFIG_PARAM
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *upstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *upstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
@ -133,8 +133,8 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
DOWNSTREAM down; /* The downstream filter */
|
||||
UPSTREAM up; /* The upstream filter */
|
||||
MXS_DOWNSTREAM down; /* The downstream filter */
|
||||
MXS_UPSTREAM up; /* The upstream filter */
|
||||
int active; /* filter is active? */
|
||||
bool use_ok;
|
||||
int client_multistatement;
|
||||
@ -631,7 +631,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router.
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
TEE_SESSION *my_session = (TEE_SESSION *) session;
|
||||
my_session->down = *downstream;
|
||||
@ -646,7 +646,7 @@ setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *dow
|
||||
* @param downstream The downstream filter or router.
|
||||
*/
|
||||
static void
|
||||
setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, UPSTREAM *upstream)
|
||||
setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_UPSTREAM *upstream)
|
||||
{
|
||||
TEE_SESSION *my_session = (TEE_SESSION *) session;
|
||||
my_session->up = *upstream;
|
||||
|
@ -34,7 +34,7 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PAR
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
@ -57,8 +57,8 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
DOWNSTREAM down;
|
||||
int count;
|
||||
MXS_DOWNSTREAM down;
|
||||
int count;
|
||||
} TEST_SESSION;
|
||||
|
||||
/**
|
||||
@ -184,7 +184,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
TEST_SESSION *my_session = (TEST_SESSION *)session;
|
||||
|
||||
|
@ -52,8 +52,8 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PARAM
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *upstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *upstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
@ -99,8 +99,8 @@ typedef struct topnq
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
DOWNSTREAM down;
|
||||
UPSTREAM up;
|
||||
MXS_DOWNSTREAM down;
|
||||
MXS_UPSTREAM up;
|
||||
int active;
|
||||
char *clientHost;
|
||||
char *userName;
|
||||
@ -426,7 +426,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router.
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
TOPN_SESSION *my_session = (TOPN_SESSION *) session;
|
||||
|
||||
@ -442,7 +442,7 @@ setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *dow
|
||||
* @param upstream The upstream filter or session.
|
||||
*/
|
||||
static void
|
||||
setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, UPSTREAM *upstream)
|
||||
setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_UPSTREAM *upstream)
|
||||
{
|
||||
TOPN_SESSION *my_session = (TOPN_SESSION *) session;
|
||||
|
||||
|
@ -79,8 +79,8 @@ static MXS_FILTER *createInstance(const char *name, char **options, CONFIG_PAR
|
||||
static MXS_FILTER_SESSION *newSession(MXS_FILTER *instance, SESSION *session);
|
||||
static void closeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, UPSTREAM *upstream);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_UPSTREAM *upstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
@ -116,8 +116,8 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
DOWNSTREAM down;
|
||||
UPSTREAM up;
|
||||
MXS_DOWNSTREAM down;
|
||||
MXS_UPSTREAM up;
|
||||
int active;
|
||||
char *clientHost;
|
||||
char *userName;
|
||||
@ -392,7 +392,7 @@ freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session)
|
||||
* @param downstream The downstream filter or router.
|
||||
*/
|
||||
static void
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *downstream)
|
||||
setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_DOWNSTREAM *downstream)
|
||||
{
|
||||
TPM_SESSION *my_session = (TPM_SESSION *)session;
|
||||
|
||||
@ -408,7 +408,7 @@ setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, DOWNSTREAM *dow
|
||||
* @param upstream The upstream filter or session.
|
||||
*/
|
||||
static void
|
||||
setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, UPSTREAM *upstream)
|
||||
setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_UPSTREAM *upstream)
|
||||
{
|
||||
TPM_SESSION *my_session = (TPM_SESSION *)session;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user