Clean up.
This commit is contained in:
@ -355,9 +355,7 @@ int i;
|
|||||||
* Bump the connection count for this server
|
* Bump the connection count for this server
|
||||||
*/
|
*/
|
||||||
atomic_add(&candidate->current_connection_count, 1);
|
atomic_add(&candidate->current_connection_count, 1);
|
||||||
|
|
||||||
client_ses->backend = candidate;
|
client_ses->backend = candidate;
|
||||||
|
|
||||||
skygw_log_write(
|
skygw_log_write(
|
||||||
LOGFILE_TRACE,
|
LOGFILE_TRACE,
|
||||||
"%lu [newSession] Selected server in port %d. "
|
"%lu [newSession] Selected server in port %d. "
|
||||||
@ -369,11 +367,12 @@ int i;
|
|||||||
* Open a backend connection, putting the DCB for this
|
* Open a backend connection, putting the DCB for this
|
||||||
* connection in the client_ses->dcb
|
* connection in the client_ses->dcb
|
||||||
*/
|
*/
|
||||||
|
client_ses->dcb = dcb_connect(candidate->server,
|
||||||
if ((client_ses->dcb = dcb_connect(candidate->server, session,
|
session,
|
||||||
candidate->server->protocol)) == NULL)
|
candidate->server->protocol);
|
||||||
|
if (client_ses->dcb == NULL)
|
||||||
{
|
{
|
||||||
atomic_add(&candidate->current_connection_count, -1);
|
atomic_add(&candidate->current_connection_count, -1);
|
||||||
skygw_log_write(
|
skygw_log_write(
|
||||||
LOGFILE_ERROR,
|
LOGFILE_ERROR,
|
||||||
"%lu [newSession] Failed to establish connection to "
|
"%lu [newSession] Failed to establish connection to "
|
||||||
@ -383,7 +382,6 @@ int i;
|
|||||||
free(client_ses);
|
free(client_ses);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inst->stats.n_sessions++;
|
inst->stats.n_sessions++;
|
||||||
|
|
||||||
/* Add this session to the list of active sessions */
|
/* Add this session to the list of active sessions */
|
||||||
@ -515,17 +513,15 @@ int i = 0;
|
|||||||
* @param queue The GWBUF with reply data
|
* @param queue The GWBUF with reply data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
clientReply(ROUTER* instance, void* router_session, GWBUF* queue, DCB *backend_dcb)
|
clientReply(
|
||||||
|
ROUTER *instance,
|
||||||
|
void *router_session,
|
||||||
|
GWBUF *queue,
|
||||||
|
DCB *backend_dcb)
|
||||||
{
|
{
|
||||||
INSTANCE* inst = NULL;
|
DCB *client = NULL;
|
||||||
DCB *client = NULL;
|
|
||||||
CLIENT_SESSION* session = NULL;
|
|
||||||
|
|
||||||
inst = (INSTANCE *)instance;
|
|
||||||
session = (CLIENT_SESSION *)router_session;
|
|
||||||
|
|
||||||
client = backend_dcb->session->client;
|
client = backend_dcb->session->client;
|
||||||
|
|
||||||
client->func.write(client, queue);
|
client->func.write(client, queue);
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
|
Reference in New Issue
Block a user