MXS-2197: Make SERV_LISTENER a C++ class

The class is still mostly the same as the old C version but it now uses
std::string instead of char pointers. Changed configuration default values
so that the parameters passed to the listener allocation are always valid.
This commit is contained in:
Markus Mäkelä
2018-11-28 14:22:12 +02:00
parent 77585bdb8c
commit 01e9f71af1
15 changed files with 353 additions and 367 deletions

View File

@ -23,6 +23,8 @@
#include <maxbase/jansson.h>
#include <maxscale/buffer.h>
class SERV_LISTENER;
MXS_BEGIN_DECLS
/**
@ -44,7 +46,6 @@ typedef enum authenticator_capability
struct dcb;
struct server;
struct session;
struct servlistener;
/**
* @verbatim
@ -96,8 +97,8 @@ typedef struct mxs_authenticator
int (* authenticate)(struct dcb*);
void (* free)(struct dcb*);
void (* destroy)(void*);
int (* loadusers)(struct servlistener*);
void (* diagnostic)(struct dcb*, struct servlistener*);
int (* loadusers)(SERV_LISTENER*);
void (* diagnostic)(struct dcb*, SERV_LISTENER*);
/**
* @brief Return diagnostic information about the authenticator
@ -111,7 +112,7 @@ typedef struct mxs_authenticator
*
* @see jansson.h
*/
json_t* (*diagnostic_json)(const struct servlistener* listener);
json_t* (*diagnostic_json)(const SERV_LISTENER * listener);
/** This entry point was added to avoid calling authenticator functions
* directly when a COM_CHANGE_USER command is executed. */