Replaced explicit closeSession calls with dcb_close

The closeSession entry point shouldn't be called directly and dcb_close
should be used instead.
This commit is contained in:
Markus Makela 2015-12-09 17:00:28 +02:00 committed by MassimilianoPinto
parent 2f54f33cfb
commit c8a9eafdc0
2 changed files with 3 additions and 21 deletions

View File

@ -897,14 +897,6 @@ ROUTER_SLAVE *slave = (ROUTER_SLAVE *)router_session;
/* Unlock */
rses_end_locked_router_action(slave);
/**
* Close the slave server connection
*/
if (slave->dcb != NULL) {
CHK_DCB(slave->dcb);
dcb_close(slave->dcb);
}
}
}

View File

@ -2061,14 +2061,6 @@ char read_errmsg[BINLOG_ERROR_MSG_LEN+1];
if (hdr.ok == SLAVE_POS_READ_UNSAFE) {
ROUTER_OBJECT *router_obj;
spinlock_acquire(&router->lock);
router_obj = router->service->router;
spinlock_release(&router->lock);
MXS_ERROR("%s: Slave %s:%i, server-id %d, binlog '%s', %s",
router->service->name,
slave->dcb->remote,
@ -2081,7 +2073,7 @@ char read_errmsg[BINLOG_ERROR_MSG_LEN+1];
* Close the slave session and socket
* The slave will try to reconnect
*/
router_obj->closeSession(router->service->router_instance, slave);
dcb_close(slave->dcb);
return 0;
}
@ -2678,8 +2670,7 @@ blr_slave_disconnect_server(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, int se
/* send server_id with disconnect state to client */
n = blr_slave_send_disconnected_server(router, slave, server_id, 1);
/* force session close for matched slave */
router_obj->closeSession(router->service->router_instance, sptr);
dcb_close(sptr->dcb);
break;
} else {
@ -2777,8 +2768,7 @@ blr_slave_disconnect_all(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave)
slave->dcb->func.write(slave->dcb, pkt);
/* force session close*/
router_obj->closeSession(router->service->router_instance, sptr);
dcb_close(sptr->dcb);
}
sptr = sptr->next;