Rename UPSTREAM to MXS_UPSTREAM

And DOWNSTREAM to MXS_DOWNSTREAM
This commit is contained in:
Johan Wikman
2017-01-13 13:40:03 +02:00
parent 356690c0e5
commit 424849a9a2
20 changed files with 100 additions and 99 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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)