Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä
2020-02-10 10:47:47 +02:00
4 changed files with 20 additions and 7 deletions

View File

@ -46,15 +46,23 @@ then
if [ -d "/lib/systemd/system" ] if [ -d "/lib/systemd/system" ]
then then
cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /lib/systemd/system cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /lib/systemd/system
mkdir -p /lib/systemd/system/maxscale.service.d
systemctl daemon-reload systemctl daemon-reload
elif [ -d "/usr/lib/systemd/system" ] elif [ -d "/usr/lib/systemd/system" ]
then then
cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /usr/lib/systemd/system cp @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service /usr/lib/systemd/system
mkdir -p /usr/lib/systemd/system/maxscale.service.d
systemctl daemon-reload systemctl daemon-reload
fi 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 systemctl enable maxscale.service
else else
if [ -d "/etc/init/" ] && [ -f "@CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/upstart/maxscale.conf" ] 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 ] if [ -f /usr/lib/systemd/system/maxscale.service ]
then then
systemd stop maxscale.service systemctl stop maxscale.service
systemctl disable maxscale.service
rm /usr/lib/systemd/system/maxscale.service rm /usr/lib/systemd/system/maxscale.service
elif [ -f /lib/systemd/system/maxscale.service ] elif [ -f /lib/systemd/system/maxscale.service ]
then then
systemd stop maxscale.service systemctl stop maxscale.service
systemctl disable maxscale.service
rm /lib/systemd/system/maxscale.service rm /lib/systemd/system/maxscale.service
fi fi

View File

@ -564,11 +564,11 @@ int dcb_read(DCB* dcb,
else else
{ {
GWBUF* buffer; GWBUF* buffer;
dcb->last_read = mxs_clock();
buffer = dcb_basic_read(dcb, bytes_available, maxbytes, nreadtotal, &nsingleread); buffer = dcb_basic_read(dcb, bytes_available, maxbytes, nreadtotal, &nsingleread);
if (buffer) if (buffer)
{ {
dcb->last_read = mxs_clock();
nreadtotal += nsingleread; nreadtotal += nsingleread;
MXS_DEBUG("Read %d bytes from dcb %p in state %s fd %d.", MXS_DEBUG("Read %d bytes from dcb %p in state %s fd %d.",
nsingleread, nsingleread,
@ -718,19 +718,19 @@ static int dcb_read_SSL(DCB* dcb, GWBUF** head)
dcb_drain_writeq(dcb); dcb_drain_writeq(dcb);
} }
dcb->last_read = mxs_clock();
buffer = dcb_basic_read_SSL(dcb, &nsingleread); buffer = dcb_basic_read_SSL(dcb, &nsingleread);
if (buffer) if (buffer)
{ {
dcb->last_read = mxs_clock();
nreadtotal += nsingleread; nreadtotal += nsingleread;
*head = gwbuf_append(*head, buffer); *head = gwbuf_append(*head, buffer);
while (buffer) while (buffer)
{ {
dcb->last_read = mxs_clock();
buffer = dcb_basic_read_SSL(dcb, &nsingleread); buffer = dcb_basic_read_SSL(dcb, &nsingleread);
if (buffer) if (buffer)
{ {
dcb->last_read = mxs_clock();
nreadtotal += nsingleread; nreadtotal += nsingleread;
/*< Append read data to the gwbuf */ /*< Append read data to the gwbuf */
*head = gwbuf_append(*head, buffer); *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(); bool have_ssl = ssl && !ssl->empty();
if (have_ssl) 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. // 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_key = ssl->key.empty() ? nullptr : ssl->key.c_str();
const char* ssl_cert = ssl->cert.empty() ? nullptr : ssl->cert.c_str(); const char* ssl_cert = ssl->cert.empty() ? nullptr : ssl->cert.c_str();