modutil.c: added modutil_reply_auth_error

mysql_backend.c:gw_change_user: instead of setting flags directly to replybuffer, set server command to backend's protocol object and reply the message directly to backend where flags are set and it is replied back to client.
This commit is contained in:
VilhoRaatikka
2015-01-19 00:01:08 +02:00
parent f5d8e2366a
commit fca674b16a
3 changed files with 28 additions and 20 deletions

View File

@ -616,6 +616,25 @@ void modutil_reply_parse_error(
modutil_reply_routing_error(backend_dcb, 1064, "42000", errstr, flags);
}
/**
* Create authentication error and EPOLLIN event to event queue of the backend DCB.
* When event is notified the error message is processed as error reply and routed
* upstream to client.
*
* @param backend_dcb DCB where event is added
* @param errstr Plain-text string error
* @param flags GWBUF type flags
*/
void modutil_reply_auth_error(
DCB* backend_dcb,
char* errstr,
uint32_t flags)
{
CHK_DCB(backend_dcb);
modutil_reply_routing_error(backend_dcb, 1045, "28000", errstr, flags);
}
/**
* Create error message and EPOLLIN event to event queue of the backend DCB.
* When event is notified the message is processed as error reply and routed
@ -644,7 +663,7 @@ static void modutil_reply_routing_error(
{
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Creating buffer for error message failed.")));
"Error : Creating routing error message failed.")));
return;
}
/** Set flags that help router to process reply correctly */