Commit Graph

27 Commits

Author SHA1 Message Date
75ea1b6ea1 Fix formatting of new(std::nothrow)
The code previously formatted everything as `new( std::nothrow)`.
2018-10-04 21:50:44 +03:00
8b9fdaa0cb Remove HTTP functionality
It wasn't used so it can be removed.
2018-10-03 08:41:45 +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
a6bef0a80d Add credentials for remove REST API calls
The base URL and credentials used for REST API calls can now be defined in
the [maxscale] section. This allows encrypted passwords to be used.
2018-08-23 15:46:46 +03:00
f8fb9510c9 Add HTTP GET function
The function performs a HTTP GET on a URL and returns the HTTP response.
2018-08-23 15:46:45 +03:00
24ab3c099c Move top of the file "#pragma once" to after the following comment (swap them). If the comment is a BPL update it to the latest one 2018-08-21 13:13:15 +03:00
02ed338afa Remove mxs::Closer<json_t*>
As std::unique_ptr can now be used with a json_t, there's no need for the
closer.
2018-08-20 13:57:00 +03:00
f14380243b Rename cppdefs.hh to ccdefs.hh
For obvious reasons; the c++ suffix is .cc and not .cpp
2018-08-10 07:50:18 +03:00
862ae099b0 Construct diagnostics results in the monitor thread
MariaDBMonitor diagnostics printing is unsafe as some of the read
fields are arrays. To be on the safe side, the fields are now read
in the monitor worker thread.

Since diagnostics must work even for stopped monitors, a worker task
is used. In practice, it usually runs when the monitor is sleeping.
2018-07-20 10:18:58 +03:00
7f67fe6f14 Add string tokenization helper
The mxs::strtok function splits a string into a vector of strings based on
a set of delimiters. The function makes it easier to iterate over a set of
values given as a delimited string.
2018-07-11 14:08:52 +03:00
77a1417479 Replace TR1 headers with standard headers
Now that the C++11 standard is the default one, we can remove the TR1
headers and classes.
2018-07-11 14:08:46 +03:00
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
445eece95b MXS-1507: Fix replaying of empty transactions
If the starting of a transaction was interrupted by a server failure, the
query needs to be retried. This needs to be done as a transaction replay
to keep the routing logic consistent and simple.

When a non-autocommit transaction is interrupted, there will be no query
in progress and no replaying is needed. To handle this case, the replay
initialization logic needed to be altered to treat truly empty
transactions as a success case.
2018-06-04 19:26:36 +03:00
a2cd4feeaf Store server states as 64-bit to the monitor journal
The journal schema version was changed.
2018-05-24 11:35:34 +03:00
498572c671 MXS-1775 Add mxs::[l|r]trimmed_copy(const std::string&)
Make it more convenient to get a left-trimmed, right-trimmed
or trimmed copy of a string.
2018-05-22 16:18:17 +03:00
0f8bf9b6e2 Implement mxs::[l|r]trim(std::string&);
Also remove the non-used implementation in httprequest.cc
2018-05-21 10:18:42 +03:00
92e0b944a9 MXS-1810: Create reset method for Checksum
Resetting checksum calculations avoids some unnecessary calculations when
the result is not needed.
2018-04-26 13:44:24 +03:00
bb96c368c2 MXS-1810: Create generic Checksum class
The Checksum class defines an interface which the SHA1Checksum and
CRC32Checksum implement.

Added test unit test cases to verify that the checksums work and perform
as expected.
2018-04-26 13:44:23 +03:00
602f977be6 MXS-1810: Add mxs::Checksum class
The class is a wrapper to the SHA1 function. This should make checksum
calculations over buffers easier.
2018-04-26 13:44:23 +03:00
755d080161 MXS-1810: Add C++ hex conversion functions
Added mxs::to_hex for uint8_t types and uint8_t containers.
2018-04-26 13:44:23 +03:00
640501c03a MXS-1810: Format utils.hh
Formatted utils.hh with Astyle.
2018-04-26 13:44:23 +03:00
221658299d MXS-1502: Derive EqualPointees from std::unary_function
This is done to make it clear that the class is intended to be used as an
unary function.
2018-04-03 16:27:18 +03:00
98fb2cf5ed MXS-1503: Add EqualPointees<T> template
The templated provides an unary predicate for (shared) pointers that
allows containers containing pointers to objects to be searched, not by
pointer comparisons but by comparisons of the values that they point
to. This allows std::find_if to be used with shared pointers in a similar
manner that std::find is used with non-pointer objects.
2018-04-03 13:31:40 +03:00
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
dbfd631fed Change session registry to a template class
The template class wraps a HashMap such that only a few operations
are allowed. Usage requires specializing a RegistryTraits class
template for each entry type.
2017-05-19 10:16:37 +03:00
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
0b4c379539 Add Closer, partial RAII class
Closer is a template using which C-style resources can be managed
in a C++ context where exceptions can occur. By placing a C resource
in a Closer instance, it is certain the resource will be freed when
the closing scope is exited irrespective of whether that occurs due
to the normal control flow, due to a return statement or an exception
having been thrown.

To be used with Closer, the CloserTraits template must be specialized
for the type in question. With this change specializations are provided
for FILE*, json_t*, pcre_code* and pcre2_match_data*.
2017-01-09 09:19:59 +02:00