214 Commits

Author SHA1 Message Date
Markus Makela
1ebb998056 Fixed wrong DCB being used in gw_get_shared_session_auth_info
The caller DCB was used instead of the session client DCB. This caused
a crash when a backend DCB was getting the shared data since those DCBs
have a NULL data pointer.
2016-02-29 16:53:39 +02:00
Markus Makela
bf24f18805 Merge branch 'develop' into MXS-544 2016-02-29 10:40:33 +02:00
counterpoint
c26b5a3dd0 Tidy earlier fix and apply another - both follow the principle of not removing the link from session to client DCB when dcb_close is called for client DCB. The close will not fully complete, but will be finalised when the session is freed. At this time, no DCBs will be referring to the session. These measures protect the dcb->data in the client DCB from being lost until the session is no longer needed. 2016-02-24 15:34:02 +00:00
counterpoint
5122777829 Try to fix problem if balancing free client DCB and free session so that auth data is always available and client DCB is not freed until session is ready to be freed. Also fix problem in auth logic. 2016-02-24 10:00:45 +00:00
counterpoint
395cbdc103 Simplify handling of "client data" by having a pointer to it only in DCB and not in session structure. Change name of session->client to session->client_dcb for greater clarity. Temporary free of client data in DCB, to be moved to authenticator when it becomes a module. Fix incorrect name of listener_alloc. 2016-02-23 11:13:21 +00:00
counterpoint
866e91c088 Changes to improve robustness of SSL processing, separate it so far as possible from protocols. Separate the detailed mechanism of authentication from the MySQL protocol with a view to making it into a module later. 2016-02-15 09:29:07 +00:00
Markus Makela
cfefc046e9 Merge branch 'release-1.3.0' into develop 2016-02-11 10:23:00 +02:00
counterpoint
e58148356d Split off listener functionality and move SSL initiation from service to listener. Put GWPROTOCOL in its own header file. 2016-01-26 16:08:02 +00:00
Markus Makela
99f39cb213 MXS-548: Added missing locks to shared session data
The shared session data was accessed and modified without a lock.
2016-01-21 10:25:41 +02:00
Johan Wikman
244d7ee86c Reformat mysql_backend.c 2016-01-12 14:57:26 +02:00
Markus Makela
3c69e641b9 Fixed false backend authentication failures
It was possible that a backend server was doing authentication while the client
closed the session. The more connections the router created the more likely it
was. This caused unnecessary reloading of the database users and confusing error
messages.

With the implemented fix, there are additional checks for the session state
before the users are reloaded or error messages are logged.
2015-12-30 05:13:27 +02:00
Johan Wikman
453055a6c0 server/modules/protocol: All LOGIFs and skygw_log_writes replaced.
LOGIFs and skygw_log_writes replaced with the equivalent
MXS_[ERROR|WARNING|NOTICE|INFO|DEBUG] macros.
2015-11-17 09:21:47 +02:00
Markus Makela
30d1fc66b7 getCapabilities no longer takes arguments and returns an int. 2015-11-11 18:14:03 +02:00
counterpoint
dee20fe077 Merge remote-tracking branch 'origin/develop' into MXS-329-develop-20151111
# Conflicts:
#	server/core/CMakeLists.txt
#	server/core/buffer.c
#	server/core/service.c
#	server/modules/filter/tee.c
#	server/modules/monitor/mysql_mon.c
#	server/modules/routing/binlog/blr.c
#	server/modules/routing/binlog/blr_slave.c
#	server/modules/routing/debugcmd.c
#	server/modules/routing/readwritesplit/readwritesplit.c
#	utils/skygw_utils.cc

- resolved.
2015-11-11 11:08:02 +00:00
Johan Wikman
834a88aeda Log variables moved to log_manager.h
The log manager variables lm_enabled_log_files_bitmask, log_ses_count
and tls_log_info that earlier were declared separately in every
c-file are now declared in the log_manager.h header.
2015-11-04 14:26:53 +02:00
counterpoint
bad61b0740 Change binlog router to indicate it does not use router sessions via the getCapabilities interface. 2015-10-27 14:17:06 +00:00
counterpoint
12ceb0db02 Check for dummy session in mysql_backend protocol and ignore. 2015-10-15 14:17:49 +02:00
counterpoint
bb53eb0f6d Put extra check in hashtable_fetch to return if zero entries (should never happen but will crash if not checked); remove dcb_close from mysql_backend where it closes backend DCBs, as these should be closed by the router. 2015-10-07 17:06:21 +01:00
Markus Makela
2dfb9e3c11 Merge branch 'develop' into MXS-329 2015-09-24 17:59:36 +03:00
Martin Brampton
89667294b3 Fix exceptional cases in DCB dcb_call_callback and in MySQL backend gw_error_backend_event - close DCB and return. 2015-09-24 07:39:47 +01:00
counterpoint
95a4daecc9 Add GWBUF_POINTER_IN_BUFFER macro; add extra free calls to remove memory leaks. 2015-09-22 11:54:47 +01:00
counterpoint
7aa36b77ea Guarantee router session is present for call to clientReply; properly free callbacks; attempt to set all necessary values for dbusers; do more to ensure buffers freed. 2015-09-21 14:25:12 +01:00
counterpoint
88716c35fb Various changes to block loopholes in different cases and tidy up. 2015-09-21 09:23:22 +01:00
counterpoint
e507933c48 Need to mark the DCB dcb_errhandle_called indicator if the router error handler is not called. 2015-09-18 09:19:32 +01:00
counterpoint
f3560512ff Suppress call to router error handling where there is no router session. 2015-09-18 09:04:32 +01:00
Markus Makela
743fb5774b Improved logging. 2015-09-11 18:49:20 +03:00
counterpoint
cfeaf7d6e9 Merge remote-tracking branch 'origin/develop' into MXS-329
Conflicts:
	server/core/session.c
2015-09-10 13:07:27 +01:00
counterpoint
296e306daa Set session pointer to client dcb to null when dcb is closed. 2015-09-10 12:54:44 +01:00
counterpoint
9f01d0ec3f Fix type. 2015-09-10 10:54:33 +01:00
counterpoint
f6916a23bd Move responsibility for closing DCB on error to router error handling. Check that routers remove or disable links to closed DCB. 2015-09-09 09:33:00 +01:00
Johan Wikman
160bbb70ee MXS-251: strerror
Replaces all calls to strerror with calls to strerror_r. The former
is non-thread safe while the latter is.
2015-09-05 15:52:13 +03:00
Martin Brampton
4a1ad3df69 Attempt solution to crash caused by leaving link to backend DCB in router session. 2015-09-05 08:53:19 +01:00
Johan Wikman
b6f5108d29 Fix for MXS-335
Response handling as aborted if there is not enough data.
2015-08-31 08:30:21 +03:00
counterpoint
9c5f622481 Additional spinlock in random_jkiss. Initial attempt at implementing dummy sessions to provide total consistency - used in mysql_client in relation to authentication - a single static dummy session is used and linked from the client dcb when authentication is not yet complete. 2015-08-28 15:30:06 +01:00
Markus Makela
2d9814e0f3 Fix to MXS-270: https://mariadb.atlassian.net/browse/MXS-270
Prepared statement query responses in multiple buffers are now handled properly.
2015-08-19 17:48:24 +03:00
Markus Makela
501ea8ffc2 Removed a debug assertion which was triggered with a valid query and added more logging. 2015-08-17 22:42:04 +03:00
Markus Makela
458598141b Added checks for possible NULL value and out-of-bounds reads. 2015-08-16 22:30:04 +03:00
Markus Makela
3992f262ca Fixed Coverity defects 2015-07-14 16:17:50 +03:00
Markus Makela
6497350ab7 Merge branch 'release-1.2' into develop
Conflicts:
	server/core/adminusers.c
	server/modules/protocol/mysql_client.c
2015-07-11 17:12:48 +03:00
counterpoint
4f5de063eb Merged dcb_read and dcb_read_n into a single function (dcb_read with an extra parameter). 2015-07-10 15:12:22 +01:00
Markus Makela
fb09cbf100 Fixed queries being routed when the session is already closing. 2015-07-07 13:15:23 +03:00
counterpoint
09fdb0a2c2 Hopefully final tidy up. 2015-06-23 14:58:53 +01:00
counterpoint
b880350cf3 Complete merge of latest develop branch 2015-06-22 10:39:13 +01:00
Markus Makela
f0aed1f666 Fixed possible null pointer dereferences in mysql_backend. 2015-06-17 10:05:56 +03:00
Martin Brampton
84d5af1e00 Throw away poll events that occur for persistent pool DCBs with no related session; fix typos. 2015-06-14 18:19:30 +01:00
counterpoint
393e25e953 Fix bug in dcb; rearrange mysql_backend gw_backend_close to cope with receiving DCB that is no longer linked to a session. 2015-06-09 12:03:58 +01:00
Markus Makela
6e01757455 Added error message to users when trying to connect to a MaxScale service that only allows SSL connections. 2015-06-02 06:39:51 +03:00
Markus Makela
54d242758f Revert "Removed walking of packets from mysql_backend and moved storing of partial packets to session command handling section."
This reverts commit 9e1dc40bb549fdaf05fb4f8c12dc159c30ad4c41.
2015-03-23 11:55:03 +02:00
Markus Makela
9e1dc40bb5 Removed walking of packets from mysql_backend and moved storing of partial packets to session command handling section. 2015-03-23 11:17:07 +02:00
Markus Makela
b416455f4f Added missing type to GWBUF returned from mysql_backend. 2015-03-22 16:53:51 +02:00