mysql_client_server_protocol.h :

changed gw_receive_backend_auth declaration to return int instead of boolean.
mysql_backend.c:
	gw_read_backend_event calls gw_receive_backend_auth which either fails (== -1), succeeds with nothing to read (== 0) or succeeds (== 1). For each case there is handling. If dcb_read succeeds without read bytes, return asap.
mysql_client.c:
	gw_error_client_event, gw_client_close, gw_client_hangup_event : all close client dcb but now they also close backend dcb.
mysql_common.c:
	gw_receive_backend_auth, return -1, 0, or 1 if read from backend failed, was empty, or succeed, respectively.:
This commit is contained in:
vraatikka
2013-10-07 14:00:44 +03:00
parent 80b67d1083
commit 655a6537b2
6 changed files with 138 additions and 34 deletions

View File

@ -239,7 +239,7 @@ void gw_mysql_close(MySQLProtocol **ptr);
MySQLProtocol* mysql_protocol_init(DCB* dcb, int fd);
MySQLProtocol *gw_mysql_init(MySQLProtocol *data);
void gw_mysql_close(MySQLProtocol **ptr);
bool gw_receive_backend_auth(MySQLProtocol *protocol);
int gw_receive_backend_auth(MySQLProtocol *protocol);
int gw_decode_mysql_server_handshake(MySQLProtocol *protocol, uint8_t *payload);
int gw_read_backend_handshake(MySQLProtocol *protocol);
int gw_send_authentication_to_backend(