MXS-2196: Remove redundant DCB member variables

The variables held duplicate information already present in other parts of
the system.
This commit is contained in:
Markus Mäkelä
2018-11-30 17:17:34 +02:00
parent 694d4a4003
commit 7a87ff9ce1
6 changed files with 32 additions and 85 deletions

View File

@ -482,7 +482,7 @@ static int gw_read_backend_event(DCB* dcb)
{
/** If a DCB gets a read event when it's in the persistent pool, it is
* treated as if it were an error. */
dcb->dcb_errhandle_called = true;
poll_fake_hangup_event(dcb);
return 0;
}
@ -603,7 +603,6 @@ static void do_handle_error(DCB* dcb, mxs_error_action_t action, const char* err
&succp);
gwbuf_free(errbuf);
dcb->dcb_errhandle_called = true;
}
/**
* If error handler fails it means that routing session can't continue
@ -1352,27 +1351,26 @@ static int gw_backend_hangup(DCB* dcb)
{
MXS_SESSION* session = dcb->session;
if (dcb->persistentstart)
if (!dcb->persistentstart)
{
dcb->dcb_errhandle_called = true;
}
else if (session->state != SESSION_STATE_ROUTER_READY)
{
int error;
int len = sizeof(error);
if (getsockopt(dcb->fd, SOL_SOCKET, SO_ERROR, &error, (socklen_t*) &len) == 0)
if (session->state != SESSION_STATE_ROUTER_READY)
{
if (error != 0 && session->state != SESSION_STATE_STOPPING)
int error;
int len = sizeof(error);
if (getsockopt(dcb->fd, SOL_SOCKET, SO_ERROR, &error, (socklen_t*) &len) == 0)
{
MXS_ERROR("Hangup in session that is not ready for routing, "
"Error reported is '%s'.",
mxs_strerror(errno));
if (error != 0 && session->state != SESSION_STATE_STOPPING)
{
MXS_ERROR("Hangup in session that is not ready for routing, "
"Error reported is '%s'.",
mxs_strerror(errno));
}
}
}
}
else
{
do_handle_error(dcb, ERRACT_NEW_CONNECTION, "Lost connection to backend server.");
else
{
do_handle_error(dcb, ERRACT_NEW_CONNECTION, "Lost connection to backend server.");
}
}
return 1;

View File

@ -1194,9 +1194,6 @@ static int gw_read_finish_processing(DCB* dcb, GWBUF* read_buffer, uint64_t capa
MySQLProtocol* proto = (MySQLProtocol*)dcb->protocol;
int return_code = 0;
/** Reset error handler when routing of the new query begins */
dcb->dcb_errhandle_called = false;
if (rcap_type_required(capabilities, RCAP_TYPE_STMT_INPUT)
|| proto->current_command == MXS_COM_CHANGE_USER)
{