Get service capabilities from a better source

The DCB pointer in the MySQLProtocol struct doesn't appear to be updated
in all cases which causes it to be an unreliable source. As the session
itself is always available and it always has the service pointer properly
set, it should be used instead.

Also removed the dead protocol compression code and replaced the
parameters with the service capability bits.
This commit is contained in:
Markus Mäkelä
2018-03-15 23:02:49 +02:00
parent 20c5ca1619
commit 10a9d70851
3 changed files with 13 additions and 19 deletions

View File

@ -510,15 +510,16 @@ int gw_decode_mysql_server_handshake(MySQLProtocol *conn, uint8_t *payload);
/**
* Create a response to the server handshake
*
* @param client Shared session data
* @param conn MySQL Protocol object for this connection
* @param with_ssl Whether to create an SSL response or a normal response packet
* @param ssl_established Set to true if the SSL response has been sent
* @param client Shared session data
* @param conn MySQL Protocol object for this connection
* @param with_ssl Whether to create an SSL response or a normal response packet
* @param ssl_established Set to true if the SSL response has been sent
* @param service_capabilities Capabilities of the connecting service
*
* @return Generated response packet
*/
GWBUF* gw_generate_auth_response(MYSQL_session* client, MySQLProtocol *conn,
bool with_ssl, bool ssl_established);
bool with_ssl, bool ssl_established, uint64_t service_capabilities);
/** Read the backend server's handshake */
bool gw_read_backend_handshake(DCB *dcb, GWBUF *buffer);