Detected closed socket in mysql_client.c:gw_read_client_event now calls the closeSession.

This will fix left opened backend connections if the client connection aborts
This commit is contained in:
Massimiliano Pinto 2013-10-02 11:15:04 +02:00
parent c55ca0aaee
commit 37bd63b33b

View File

@ -539,7 +539,7 @@ int gw_read_client_event(DCB* dcb) {
}
/**
* Socket was closed.
* The client socket was closed.
*/
if (b == 0) {
skygw_log_write(
@ -554,6 +554,17 @@ int gw_read_client_event(DCB* dcb) {
dcb->func.close(dcb);
}
rc = 0;
// get the backend session, if available, and close the session
if (session != NULL) {
CHK_SESSION(session);
router = session->service->router;
router_instance = session->service->router_instance;
rsession = session->router_session;
if (rsession)
router->closeSession(router_instance, rsession);
}
goto return_rc;
}