Send error on client DCB hangup events

Sending an error to the client allows the connector to show more
information to the user when the DCB is closed due to a reason internal to
MaxScale.

The error message states that the connection was killed by MaxScale to
distinct it from the error sent by the server. The error number and SQL
state are still the same as both errors should be treated the same way.
This commit is contained in:
Markus Mäkelä 2017-11-15 14:43:35 +02:00
parent fbdd6601e9
commit 060a96d7f3

View File

@ -1424,7 +1424,7 @@ gw_client_close(DCB *dcb)
/**
* Handle a hangup event on the client side descriptor.
*
* We simply close the DCB, this will propogate the closure to any
* We simply close the DCB, this will propagate the closure to any
* backend descriptors and perform the session cleanup.
*
* @param dcb The DCB of the connection
@ -1446,6 +1446,7 @@ static int gw_client_hangup_event(DCB *dcb)
goto retblock;
}
modutil_send_mysql_err_packet(dcb, 0, 0, 1927, "70100", "Connection killed by MaxScale");
dcb_close(dcb);
retblock: