Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä 2020-02-10 10:47:47 +02:00
commit cb016fb90a
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499
4 changed files with 20 additions and 7 deletions

View File

@ -46,15 +46,23 @@ then
if [ -d "/lib/systemd/system" ]
then
cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /lib/systemd/system
mkdir -p /lib/systemd/system/maxscale.service.d
systemctl daemon-reload
elif [ -d "/usr/lib/systemd/system" ]
then
cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /usr/lib/systemd/system
mkdir -p /usr/lib/systemd/system/maxscale.service.d
systemctl daemon-reload
fi
# Remove old directories, mistakenly installed by a few versions
if [ -d /lib/systemd/system/maxscale.service.d ]
then
rmdir /lib/systemd/system/maxscale.service.d
elif [ -d /usr/lib/systemd/system/maxscale.service.d ]
then
rmdir /lib/systemd/system/maxscale.service.d
fi
mkdir -p /etc/systemd/system/maxscale.service.d
systemctl enable maxscale.service
else
if [ -d "/etc/init/" ] && [ -f "@CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/upstart/maxscale.conf" ]

View File

@ -17,11 +17,13 @@ then
if [ -f /usr/lib/systemd/system/maxscale.service ]
then
systemd stop maxscale.service
systemctl stop maxscale.service
systemctl disable maxscale.service
rm /usr/lib/systemd/system/maxscale.service
elif [ -f /lib/systemd/system/maxscale.service ]
then
systemd stop maxscale.service
systemctl stop maxscale.service
systemctl disable maxscale.service
rm /lib/systemd/system/maxscale.service
fi

View File

@ -564,11 +564,11 @@ int dcb_read(DCB* dcb,
else
{
GWBUF* buffer;
dcb->last_read = mxs_clock();
buffer = dcb_basic_read(dcb, bytes_available, maxbytes, nreadtotal, &nsingleread);
if (buffer)
{
dcb->last_read = mxs_clock();
nreadtotal += nsingleread;
MXS_DEBUG("Read %d bytes from dcb %p in state %s fd %d.",
nsingleread,
@ -718,19 +718,19 @@ static int dcb_read_SSL(DCB* dcb, GWBUF** head)
dcb_drain_writeq(dcb);
}
dcb->last_read = mxs_clock();
buffer = dcb_basic_read_SSL(dcb, &nsingleread);
if (buffer)
{
dcb->last_read = mxs_clock();
nreadtotal += nsingleread;
*head = gwbuf_append(*head, buffer);
while (buffer)
{
dcb->last_read = mxs_clock();
buffer = dcb_basic_read_SSL(dcb, &nsingleread);
if (buffer)
{
dcb->last_read = mxs_clock();
nreadtotal += nsingleread;
/*< Append read data to the gwbuf */
*head = gwbuf_append(*head, buffer);

View File

@ -39,6 +39,9 @@ MYSQL* mxs_mysql_real_connect(MYSQL* con, SERVER* server, const char* user, cons
bool have_ssl = ssl && !ssl->empty();
if (have_ssl)
{
char enforce_tls = 1;
mysql_optionsv(con, MYSQL_OPT_SSL_ENFORCE, (void*)&enforce_tls);
// If an option is empty, a null-pointer should be given to mysql_ssl_set.
const char* ssl_key = ssl->key.empty() ? nullptr : ssl->key.c_str();
const char* ssl_cert = ssl->cert.empty() ? nullptr : ssl->cert.c_str();