From a2f5cc9d09fdbeee3692b51aeff1a43cc0f652c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 3 Dec 2018 09:17:19 +0200 Subject: [PATCH] MXS-2196: Rename struct session to struct MXS_SESSION --- Documentation/Design-Documents/Plugin-development-guide.md | 4 ++-- include/maxscale/authenticator.h | 2 +- include/maxscale/dcb.hh | 6 +++--- include/maxscale/protocol.h | 6 +++--- include/maxscale/session.hh | 4 ++-- server/core/session.cc | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Documentation/Design-Documents/Plugin-development-guide.md b/Documentation/Design-Documents/Plugin-development-guide.md index 39bebdbe8..012a67f4a 100644 --- a/Documentation/Design-Documents/Plugin-development-guide.md +++ b/Documentation/Design-Documents/Plugin-development-guide.md @@ -232,10 +232,10 @@ int32_t write_ready(struct dcb *) int32_t error(struct dcb *) int32_t hangup(struct dcb *) int32_t accept(struct dcb *) -int32_t connect(struct dcb *, struct server *, struct session *) +int32_t connect(struct dcb*, struct server*, MXS_SESSION*) int32_t close(struct dcb *) int32_t listen(struct dcb *, char *) -int32_t auth(struct dcb *, struct server *, struct session *, GWBUF *) +int32_t auth(struct dcb*, struct server*, MXS_SESSION*, GWBUF*) int32_t session(struct dcb *, void *) char auth_default() int32_t connlimit(struct dcb *, int limit) diff --git a/include/maxscale/authenticator.h b/include/maxscale/authenticator.h index 16b2b0dc3..30d94d189 100644 --- a/include/maxscale/authenticator.h +++ b/include/maxscale/authenticator.h @@ -45,7 +45,7 @@ typedef enum authenticator_capability struct DCB; struct server; -struct session; +struct MXS_SESSION; /** * @verbatim diff --git a/include/maxscale/dcb.hh b/include/maxscale/dcb.hh index 949b10633..7405990b6 100644 --- a/include/maxscale/dcb.hh +++ b/include/maxscale/dcb.hh @@ -36,7 +36,7 @@ MXS_BEGIN_DECLS #define ERRHANDLE -struct session; +struct MXS_SESSION; struct server; struct DCB; @@ -172,7 +172,7 @@ struct DCB : public MXB_POLL_DATA void* protocol = nullptr; /**< The protocol specific state */ size_t protocol_packet_length = 0; /**< protocol packet length */ size_t protocol_bytes_processed = 0; /**< How many bytes have been read */ - struct session* session; /**< The owning session */ + MXS_SESSION* session; /**< The owning session */ SListener listener; /**< The origin of the connection */ MXS_PROTOCOL func = {}; /**< Protocol functions for the DCB */ MXS_AUTHENTICATOR authfunc = {}; /**< Authenticator functions for the DCB */ @@ -244,7 +244,7 @@ void dcb_global_init(); int dcb_write(DCB*, GWBUF*); DCB* dcb_alloc(dcb_role_t, const SListener&, SERVICE* service); -DCB* dcb_connect(struct server*, struct session*, const char*); +DCB* dcb_connect(struct server*, MXS_SESSION*, const char*); int dcb_read(DCB*, GWBUF**, int); int dcb_drain_writeq(DCB*); void dcb_close(DCB*); diff --git a/include/maxscale/protocol.h b/include/maxscale/protocol.h index c0942cde6..e91115b5f 100644 --- a/include/maxscale/protocol.h +++ b/include/maxscale/protocol.h @@ -27,7 +27,7 @@ MXS_BEGIN_DECLS struct DCB; struct server; -struct session; +struct MXS_SESSION; /** * Protocol module API @@ -106,7 +106,7 @@ typedef struct mxs_protocol * * @return The opened file descriptor or DCBFD_CLOSED on error */ - int32_t (* connect)(DCB* dcb, struct server* server, struct session* session); + int32_t (* connect)(DCB* dcb, struct server* server, MXS_SESSION* session); /** * Free protocol data allocated in the connect handler @@ -131,7 +131,7 @@ typedef struct mxs_protocol * * @note Currently the return value is ignored */ - int32_t (* auth)(DCB* dcb, struct server* server, struct session* session, GWBUF* buffer); + int32_t (* auth)(DCB* dcb, struct server* server, MXS_SESSION* session, GWBUF* buffer); /** * Returns the name of the default authenticator module for this protocol diff --git a/include/maxscale/session.hh b/include/maxscale/session.hh index a2d94b714..21068ac0c 100644 --- a/include/maxscale/session.hh +++ b/include/maxscale/session.hh @@ -205,7 +205,7 @@ typedef char* (* session_variable_handler_t)(void* context, * Note that the first few fields (up to and including "entry_is_ready") must * precisely match the LIST_ENTRY structure defined in the list manager. */ -typedef struct session +struct MXS_SESSION { mxs_session_state_t state; /*< Current descriptor state */ uint64_t ses_id; /*< Unique session identifier */ @@ -229,7 +229,7 @@ typedef struct session } response; /*< Shortcircuited response */ session_close_t close_reason; /*< Reason why the session was closed */ bool load_active; /*< Data streaming state (for LOAD DATA LOCAL INFILE) */ -} MXS_SESSION; +}; /** * A filter that terminates the request processing and delivers a response diff --git a/server/core/session.cc b/server/core/session.cc index ad3697029..f3ef5a652 100644 --- a/server/core/session.cc +++ b/server/core/session.cc @@ -69,9 +69,9 @@ struct SESSION_DUMP_STATEMENTS_NEVER }; -static struct session dummy_session() +static MXS_SESSION dummy_session() { - struct session session = {}; + MXS_SESSION session = {}; session.state = SESSION_STATE_DUMMY; session.refcount = 1; return session; @@ -79,7 +79,7 @@ static struct session dummy_session() } -static struct session session_dummy_struct = dummy_session(); +static MXS_SESSION session_dummy_struct = dummy_session(); static void session_initialize(void* session); static int session_setup_filters(MXS_SESSION* session);