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

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