Commit Graph

116 Commits

Author SHA1 Message Date
3b55893a20 Combine maxscale/buffer.h with maxscale/buffer.hh 2019-01-17 12:37:40 +02:00
ebbb8a771c Merge branch '2.3' into develop 2019-01-17 10:55:27 +02:00
a469ef83b6 MXS-2217: Pick DCB owner before adding to epoll
There is a race condition between the addition of the DCB into epoll and
the execution of the event that initiates the protocol pointer for the DCB
and sends the handshake to the client. If a hangup event would occur
before the handshake would be sent, it would be possible that the DCB
would get freed before the code that sends the handshake is executed.

By picking the worker who owns the DCB before the DCB is placed into the
owner's epoll instance, we make sure no events arrive on the DCB while the
control is transferred from the accepting worker to the owning
worker.
2019-01-17 10:35:49 +02:00
d4674faa7d Convert maxscale/query_classifier.h to .hh
The header was not merged with queryclassifier.hh since the latter
does not include the former.
2019-01-15 18:18:39 +02:00
45bfbbdd9e Convert maxscale/protocol.h to .hh 2019-01-15 17:26:26 +02:00
b0663f0b29 Convert maxscale/ssl.h to .hh 2019-01-15 17:12:32 +02:00
684ec3288b Rename and cleanup authenticator.h 2019-01-14 15:07:33 +02:00
f0f9c21d1c Merge branch '2.3' into develop 2019-01-07 10:54:42 +02:00
09aa54720d MXS-2220 Read server version using public methods
Version related fields have been removed from the public class.
2019-01-03 11:23:14 +02:00
26da72a41f Merge branch '2.2' into 2.3 2019-01-03 09:23:16 +02:00
8f0e4a3034 MXS-2232: Fix version string prefix check
The prefix was always added even when the original version would've been
acceptable. For example, a version string of 5.5.40 would get converted to
5.5.5-5.5.40 which is quite confusing for older client applications.
2019-01-02 19:29:48 +02:00
04dd05b262 MXS-2231: Move TLS handshake code into MariaDBClient
The code is now in the correct place and TLS connections with all
authenticators should now work.
2019-01-02 19:29:41 +02:00
20fe9b9dca MXS-2196: Rename session states
Minor renaming of the session state enum values. Also exposed the session
state stringification function in the public header and removed the
stringification macro.
2018-12-13 13:27:45 +02:00
c0c9a9858d MXS-2197 Rename maxscale/log.h to maxscale/log.hh
In files either include maxscale/log.hh or remove include entirelly
as maxscale/ccdefs.hh includes it.
2018-12-10 12:58:17 +02:00
77477d9648 MXS-2196: Rename dcb_role_t to DCB::Role 2018-12-05 15:30:44 +02:00
9f721f725e MXS-2205 Convert maxscale/protocol/mysql.h to .hh 2018-12-05 11:12:20 +02:00
d96a7dedc5 MXS-2205 Convert maxscale/poll.h to .hh 2018-12-04 14:51:02 +02:00
43c33e9f4a MXS-2196: Allocate a session before allocating DCBs
Allocating the session before a DCB guarantees that at no point will a DCB
have a null session. This further clarifies the concept of the session and
also allows the listener reference to be moved there.

Ideally, the session itself would allocate and assign the client DCB but
since the Listener is the only one who does it, it's acceptable for now.
2018-12-04 11:50:43 +02:00
692127a2cb MXS-2196: Remove the dummy session
As each connection now immediately gets a session the dummy session is no
longer required. The next step would be to combine parts of the session
and the client DCB into one entity. This would prevent the possibility of
a client DCB with no associated session. Backend DCBs are different as
they can move from one session to another when the persistent connection
pool is in use.
2018-12-04 11:50:43 +02:00
da9816b7e7 MXS-2196: Always allocate a session
Whenever a client DCB is accepted, a session for it is allocated. This
simplifies the handling of shared data between DCBs by allowing it to be
placed inside the session object. Currently, the data is stashed away in
the client DCB.
2018-12-04 11:50:43 +02:00
3791fdded7 MXS-2196: Pass client DCB to MXS_PROTOCOL::accept
By doing the actual accepting of the new DCB in the core, the protocol
modules can only do the actual protocol level work. This removes some of
the redundant code that was in the protocol modules.
2018-12-04 11:50:43 +02:00
e46104c32a MXS-2196: Use Listener in MXS_PROTOCOL::accept 2018-12-04 11:50:43 +02:00
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
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
3b5e45ceee MXS-2196: Combine session.h and session.hh
Combined the public session headers into one.
2018-12-04 11:43:38 +02:00
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
a10b6c2e89 MXS-2196: Take Listener into use 2018-12-04 11:39:52 +02:00
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
756593a718 MXS-2205 Combine maxscale/router.h with maxscale/router.hh 2018-12-03 15:28:06 +02:00
97bb7e7e1a MXS-2205 Combine maxscale/modutil.h with maxscale/modutil.hh 2018-12-03 15:28:06 +02:00
81937c635b Fix current command tracking during LDLI
When a LOAD DATA LOCAL INFILE was executed, the client and backend
protocols would update the command byte leading to misinterpretations of
the data.
2018-11-27 12:52:44 +02:00
433c6708bf Merge branch '2.2' into 2.3 2018-11-13 17:35:45 +02:00
fb84b2690a MXS-2159: Combine client capability bits
If the client sends two different sets of capability bits during the
authentication phase of an SSL enabled connection, both sets need to be
combined. This prevents capabilities from degrading mid-connection which
is the case when Oracle Connector/J drops the SSL capability bit
mid-authentication.
2018-11-13 11:37:48 +02:00
b59eb28802 Merge branch '2.2' into 2.3 2018-11-12 12:51:18 +02:00
f4dd0628da Fix COM_CHANGE_USER handling
If the service doesn't require collection of complete packets, the user
reauthentication done with COM_CHANGE_USER would be skipped. This caused
the change_user test to fail.

By temporarily switching to full packet collection mode for the duration
of the COM_CHANGE_USER, we avoid duplicating the code for the streaming
router types.
2018-11-11 17:19:52 +02:00
0a9d24230a Fix cross-thread buffer usage
If the initial handshake that is sent by the accepting thread is buffered,
the subsequent flushing of it is done by the owning thread. As
cross-thread buffer usage is not allowed, the initial handshake must be
sent by the owning thread.
2018-11-09 12:13:22 +02:00
e5d6e5329a Format source code
Formatted all of the source code that was not accordance with the coding
style. This was caused by merges from 2.2 into 2.3.
2018-11-01 14:05:15 +02:00
7deed35587 Merge branch '2.2' into 2.3 2018-10-31 09:03:09 +02:00
47e7595a08 MXS-2115: Fix regression
The 5.5.5 prefix in the version strings was not added.
2018-10-30 18:43:37 +02:00
ce35b0d541 Merge branch '2.2' into 2.3 2018-10-30 14:16:33 +02:00
7e21e3aedd MXS-2115: Fix handshake version string
The intention was to send the lowest backend version string automatically
to the client instead of the default handshake version. This did not work
as the service version string was used instead of the server version.
2018-10-30 12:45:23 +02:00
71ffef5708 Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
108638b0cf Format with Uncrustify 0.67 2018-09-10 13:31:39 +03:00
d11c78ad80 Format all sources with Uncrustify
Formatted all sources and manually tuned some files to make the code look
neater.
2018-09-10 13:22:49 +03:00
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
a13e95951b Merge branch '2.2' into develop 2018-08-30 11:37:49 +03:00
5f4aa46552 MXS-2027: Store LOAD DATA state inside MXS_SESSION
By storing the data gathere by readwritesplit inside the session, the
protocol will be aware of the state of the LOAD DATA LOCAL INFILE
execution. This prevents misinterpretation of the data which previously
led to closed connections, effectively rendering LOAD DATA LOCAL INFILE
unusable.

This change is a temporary solution to a problem that needs to be solved
at the protocol level. The changes required to implement this are too big
to add into a bug fix release.
2018-08-29 18:10:51 +03:00
9a6f1b2044 Merge branch '2.2' into develop 2018-08-28 16:06:23 +03:00
a50e8e9ce6 MXS-2024: Prevent stack overflow
If a large packet is received, the stack would overflow when the username
size was determined from the packet size. The code must not assume
anything about the size of the packet being read.
2018-08-27 20:35:09 +03:00
2c54f28fae MXS-2024: Validate COM_CHANGE_USER packet before use
The use of strcpy on data that is assumed to be null terminated causes
reads and writes past buffers.
2018-08-24 20:52:52 +03:00