MXS-2196: Fix persistent connections

The connections now use the correct parameter.
This commit is contained in:
Markus Mäkelä
2018-12-04 13:02:06 +02:00
parent 3cc34f0696
commit 7ca421fe5f

View File

@ -261,17 +261,18 @@ DCB* server_get_persistent(SERVER* server, const char* user, const char* ip, con
&& server->persistent[id] // Check after cleaning && server->persistent[id] // Check after cleaning
&& (server->status & SERVER_RUNNING)) && (server->status & SERVER_RUNNING))
{ {
mxb_assert(dcb->server);
dcb = server->persistent[id]; dcb = server->persistent[id];
while (dcb) while (dcb)
{ {
// TODO: Fix this, it won't work (DCB in pool has no session)
if (dcb->user if (dcb->user
&& dcb->remote && dcb->remote
&& ip && ip
&& !dcb->dcb_errhandle_called && !dcb->dcb_errhandle_called
&& 0 == strcmp(dcb->user, user) && 0 == strcmp(dcb->user, user)
&& 0 == strcmp(dcb->remote, ip) && 0 == strcmp(dcb->remote, ip)
&& 0 == strcmp(dcb->session->listener->protocol(), protocol)) && 0 == strcmp(dcb->server->protocol, protocol))
{ {
if (NULL == previous) if (NULL == previous)
{ {