Compile filter.c as C++

The contents of the existing filter.cc was copied into filter.c that
subsequently was renamed to filter.cc.

The way the session is called as the last filter in the filter chain
is really dubious and ought to be rearranged so that the blind casting
of a session to a filter and back is not needed.
This commit is contained in:
Johan Wikman
2017-03-23 16:36:21 +02:00
parent db18e19d3c
commit 9a22d1cb92
7 changed files with 489 additions and 488 deletions

View File

@ -94,11 +94,14 @@ typedef struct
* The downstream element in the filter chain. This may refer to
* another filter or to a router.
*/
struct mxs_filter;
struct mxs_filter_session;
typedef struct mxs_downstream
{
void *instance;
void *session;
int32_t (*routeQuery)(void *instance, void *session, GWBUF *request);
struct mxs_filter *instance;
struct mxs_filter_session *session;
int32_t (*routeQuery)(struct mxs_filter *instance, struct mxs_filter_session *session, GWBUF *request);
} MXS_DOWNSTREAM;
/**
@ -107,9 +110,9 @@ typedef struct mxs_downstream
*/
typedef struct mxs_upstream
{
void *instance;
void *session;
int32_t (*clientReply)(void *instance, void *session, GWBUF *response);
struct mxs_filter *instance;
struct mxs_filter_session *session;
int32_t (*clientReply)(struct mxs_filter *instance, struct mxs_filter_session *session, GWBUF *response);
int32_t (*error)(void *instance, void *session, void *);
} MXS_UPSTREAM;