12324 Commits

Author SHA1 Message Date
Markus Mäkelä
7a87ff9ce1
MXS-2196: Remove redundant DCB member variables
The variables held duplicate information already present in other parts of
the system.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
694d4a4003
MXS-2196: Make DCB a C++ struct
Allocating DCB with new allows the use of C++ objects in the DCB
struct. Also the explicit poll field can be replaced by inheriting from
MXB_POLL_DATA.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
e365b97c6e
MXS-2196: Rename struct dcb to struct DCB
Renamed the DCB struct and removed the typedef.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
ad12ff6d06
MXS-2196: Rename dcb.h to dcb.hh 2018-12-04 11:50:43 +02:00
Markus Mäkelä
3b5e45ceee
MXS-2196: Combine session.h and session.hh
Combined the public session headers into one.
2018-12-04 11:43:38 +02:00
Markus Mäkelä
5a79dbfb53
MXS-2196: Track listener state
The listener now tracks its own the state instead of using the session
state.
2018-12-04 11:39:53 +02:00
Markus Mäkelä
ccc91df0c7
MXS-2196: Pass Listener into dcb_accept
Modified the functions to use a listener instead of a DCB in the accepting
process. This removes some of the dependenices that the listeners have on
the DCB system.
2018-12-04 11:39:53 +02:00
Markus Mäkelä
9c679edea6
MXS-2196: Preload DCB entry points in Listener
By loading the entry points required by a DCB when the Listener is
created, the extra cost of finding the module is removed. It also
simplifies DCB creation by removing the possibility of all failures to
load modules at DCB creation time.
2018-12-04 11:39:53 +02:00
Markus Mäkelä
c858f7f080
MXS-2196: Use smart pointers for lifetime management
The listeners no longer internally track whether they are active or
not. All of the heavy lifting is now done by std::shared_ptr.
2018-12-04 11:39:53 +02:00
Markus Mäkelä
a10b6c2e89
MXS-2196: Take Listener into use 2018-12-04 11:39:52 +02:00
Markus Mäkelä
330719c8f9
MXS-2196: Store listener references in Service
By storing a shared pointer to the listeners in the services, they will be
available as long as the service using them exists. This enables clean
destruction of listeners that still have open sessions.

The listener creation code now separately creates the listener and links
it to the service. Also replaced relevant parts of the related code with
the listener implemented versions of it.
2018-12-04 11:39:52 +02:00
Markus Mäkelä
a6063b5e85
MXS-2196: Remove listen entry point from protocol
The entry point was useless as all of the modules called the same
function.
2018-12-04 11:39:52 +02:00
Markus Mäkelä
ae3763da92
MXS-2196: Replace listener_alloc with Listener::create 2018-12-04 11:39:52 +02:00
Markus Mäkelä
39f668ff3c
MXS-2196: Rename SERV_LISTENER to Listener 2018-12-04 11:39:52 +02:00
Markus Mäkelä
8c847ec10d
MXS-2196: Move listener functionality into member functions
Moved most of the listener related processing inside the SERV_LISTENER (to
be renamed into Listener) class.
2018-12-04 11:39:52 +02:00
Markus Mäkelä
67626d6c32
MXS-2196: Pass the SERVICE pointer when allocating a DCB
The value would otherwise be assigned outside of it and in some cases not
at all. Now all DCBs (apart from internal ones) have a valid SERVICE
pointer.

The SERV_LISTENER pointer should not be in the DCBs but in the
session. This way the listener is an attribute of a session instead of a
connection. If this is implemented, the authenticator data can be more
easily shared.
2018-12-04 11:39:51 +02:00
Markus Mäkelä
bb295b5cbe
MXS-2196: Remove listeners from services
All access to the listeners of a service are done via the listener
functions.
2018-12-04 11:39:51 +02:00
Markus Mäkelä
1c7d5f07c3
MXS-2196: Replace raw pointers with SListener references
Replaced raw pointers in function parameter with const SListener
references. This removes the need to pass raw pointers as arguments and
all access is done via smart pointers.
2018-12-04 11:39:51 +02:00
Markus Mäkelä
5247c152c2
MXS-2196: Replace listener iterator
The iteration of listeners is now done via the global list of
listeners. This removes the need to have a service before a listener is
accessed which also reflects how the actual configuration is laid out. It
also guarantees that any results returned by the find functions will be
valid as long as the results are used.
2018-12-04 11:39:51 +02:00
Markus Mäkelä
6f9b9f5e95
MXS-2196: Store listeners in a global list
The listeners are now stored in their own list which allows them to be a
component separate from the service. The next step is to remove the
listener iterator functionality and replace it with its STL counterpart.
2018-12-04 11:39:51 +02:00
Markus Mäkelä
5926ac2c3c
MXS-2196: Move listener operations into listener sources
The operations that are done on a listener are now done in the correct
source file.
2018-12-04 11:39:51 +02:00
Johan Wikman
6c281d55e2 Merge branch '2.3' into develop 2018-12-04 11:23:56 +02:00
Johan Wikman
1a78f2ffbb Merge branch '2.2' into 2.3 2018-12-04 11:23:31 +02:00
Esa Korhonen
d9ae298102 MXS-2205 Combine maxscale/server.h with maxscale/server.hh
The server-struct is still used in several .h-files.
2018-12-03 16:47:27 +02:00
Johan Wikman
87d2a45b20 MXS-2207 Fix the problem in qc_mysqlembedded 2018-12-03 16:03:51 +02:00
Johan Wikman
964180804c MXS-2207 Add test that reveals problem
With qc_mysqlembedded statements like

    SET STATEMENT ... FOR stmt;

are always classified as READ, although their type should be
that of stmt.
2018-12-03 15:59:43 +02:00
Esa Korhonen
756593a718 MXS-2205 Combine maxscale/router.h with maxscale/router.hh 2018-12-03 15:28:06 +02:00
Esa Korhonen
2dc5015499 MXS-2205 Convert readconnection.h to .hh 2018-12-03 15:28:06 +02:00
Esa Korhonen
72d8ab5220 MXS-2205 Convert modules/include/cdc.h to .hh 2018-12-03 15:28:06 +02:00
Esa Korhonen
df9fbdd31a MXS-2205 Convert modules/protocol/HTTPD/httpd.h to .hh 2018-12-03 15:28:06 +02:00
Esa Korhonen
5f7211aac5 MXS-2205 Combine maxscale/filter.h with maxscale/filter.hh 2018-12-03 15:28:06 +02:00
Esa Korhonen
8a570eb6a1 MXS-2205 Combine maxscale/monitor.h with maxscale/monitor.hh 2018-12-03 15:28:06 +02:00
Esa Korhonen
97bb7e7e1a MXS-2205 Combine maxscale/modutil.h with maxscale/modutil.hh 2018-12-03 15:28:06 +02:00
Johan Wikman
49173bbe83 Merge branch '2.3' into develop 2018-12-03 15:21:24 +02:00
Johan Wikman
1f495dec99 Merge branch '2.3.2' into 2.3 2018-12-03 15:20:33 +02:00
Johan Wikman
cd95ca7092 Update 2.3.2 release date 2018-12-03 14:51:40 +02:00
Esa Korhonen
35cdbc7220 MXS-2205 Convert modulecmd.h to .hh 2018-12-03 14:06:02 +02:00
Esa Korhonen
3e5818fcb6 MXS-2205 Convert mysql_utils.h to .hh 2018-12-03 14:05:21 +02:00
Esa Korhonen
1701f87f00 MXS-2205 Convert internal/maxscale.h and internal/dcb.h to .hh 2018-12-03 13:49:08 +02:00
Esa Korhonen
cdf323384c MXS-2205 Combine internal/session.h with internal/session.hh 2018-12-03 13:47:39 +02:00
Esa Korhonen
36792607d8 MXS-2205 Combine internal/modules.h with internal/modules.hh 2018-12-03 13:36:25 +02:00
Esa Korhonen
b15f43bc81 MXS-2205 Convert config_runtime.h and externcmd.h to .hh 2018-12-03 13:34:33 +02:00
Esa Korhonen
344c7dde4a MXS-2205 Combine internal monitor headers
Contents of monitor.h moved to monitor.hh
2018-12-03 13:32:09 +02:00
Esa Korhonen
0f755adc78 MySQLAuth header to .hh 2018-12-03 11:00:29 +02:00
Esa Korhonen
760f2ff34c Move alloc.cc to maxbase
Only renames the functions. Macro names are left as is to keep the diff
small.
2018-12-03 10:20:45 +02:00
Esa Korhonen
0c7e737eb7 Move some mysql/mariadb utilities to maxutils
Can be used in system tests later on.
2018-11-30 13:03:37 +02:00
Esa Korhonen
a6fe6a0463 Delete internal/worker.h
Was unused.
2018-11-30 12:22:51 +02:00
Markus Mäkelä
01e9f71af1
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.
2018-11-30 12:15:57 +02:00
Markus Mäkelä
77585bdb8c
MXS-2197: Make config.h and service.h C++ headers
This is the first step into converting the other headers into C++.
2018-11-30 12:15:57 +02:00
Markus Mäkelä
fb533df22e
MXS-2197: Compile all cache parts as C++
This is required if all headers are converted into C++ as it includes
MaxScale headers.
2018-11-30 12:15:57 +02:00