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:
@ -35,7 +35,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <maxscale/config.hh>
|
||||
#include <maxscale/listener.h>
|
||||
#include <maxscale/listener.hh>
|
||||
#include <maxscale/routingworker.hh>
|
||||
|
||||
#include "../dcb.cc"
|
||||
@ -48,10 +48,10 @@
|
||||
static int test1()
|
||||
{
|
||||
DCB* dcb;
|
||||
SERV_LISTENER dummy;
|
||||
SERV_LISTENER* dummy = nullptr;
|
||||
/* Single buffer tests */
|
||||
fprintf(stderr, "testdcb : creating buffer with type DCB_ROLE_INTERNAL");
|
||||
dcb = dcb_alloc(DCB_ROLE_INTERNAL, &dummy);
|
||||
dcb = dcb_alloc(DCB_ROLE_INTERNAL, dummy);
|
||||
printDCB(dcb);
|
||||
fprintf(stderr, "\t..done\nAllocated dcb.");
|
||||
// TODO: Without running workers, the following will hang. As it does not
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <maxscale/dcb.h>
|
||||
#include <maxscale/listener.h>
|
||||
#include <maxscale/listener.hh>
|
||||
#include <maxscale/service.hh>
|
||||
|
||||
#include "test_utils.h"
|
||||
@ -49,7 +49,7 @@ static int test1()
|
||||
DCB* dcb;
|
||||
int result;
|
||||
int eno = 0;
|
||||
SERV_LISTENER dummy;
|
||||
SERV_LISTENER* dummy = nullptr;
|
||||
|
||||
SERVICE service;
|
||||
service.routerModule = (char*)"required by a check in dcb.cc";
|
||||
@ -59,7 +59,7 @@ static int test1()
|
||||
"testpoll : Initialise the polling system.");
|
||||
init_test_env(NULL);
|
||||
fprintf(stderr, "\t..done\nAdd a DCB");
|
||||
dcb = dcb_alloc(DCB_ROLE_CLIENT_HANDLER, &dummy);
|
||||
dcb = dcb_alloc(DCB_ROLE_CLIENT_HANDLER, dummy);
|
||||
|
||||
if (dcb == NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user