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

@ -43,7 +43,7 @@
#include <maxbase/atomic.hh>
#include <maxscale/clock.h>
#include <maxscale/limits.h>
#include <maxscale/listener.h>
#include <maxscale/listener.hh>
#include <maxscale/log.h>
#include <maxscale/poll.h>
#include <maxscale/router.h>
@ -2451,9 +2451,9 @@ DCB* dcb_accept(DCB* dcb)
}
}
memcpy(&client_dcb->func, protocol_funcs, sizeof(MXS_PROTOCOL));
if (dcb->listener->authenticator)
if (!dcb->listener->authenticator.empty())
{
authenticator_name = dcb->listener->authenticator;
authenticator_name = dcb->listener->authenticator.c_str();
}
else if (client_dcb->func.auth_default != NULL)
{