dcb's fd wasn't stored to client's protocol structure. Changed mysql_protocol_init to take fd as the Second argument.

This commit is contained in:
vraatikka
2013-09-14 23:01:26 +03:00
parent 4815856017
commit db7004e6ae
4 changed files with 9 additions and 8 deletions

View File

@ -464,7 +464,7 @@ static int gw_error_backend_event(DCB *dcb) {
"Writing to backend failed.");
return 0;
}
}
skygw_log_write_flush(
LOGFILE_ERROR,
"%lu [gw_error_backend_event] Some error occurred in backend.",
@ -503,7 +503,7 @@ static int gw_create_backend_connection(
int rv = -1;
int fd = -1;
protocol = mysql_protocol_init(backend_dcb);
protocol = mysql_protocol_init(backend_dcb, -1);
ss_dassert(protocol != NULL);
if (protocol == NULL) {
@ -517,8 +517,6 @@ static int gw_create_backend_connection(
/** if succeed, fd > 0, -1 otherwise */
rv = gw_do_connect_to_backend(server->name, server->port, &fd);
/** Assign fd with protocol */
protocol->fd = fd;
/** Assign protocol with backend_dcb */
backend_dcb->protocol = protocol;