- Rename MYSQLND_PROTOCOL to MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY
- Rename other symbols related to MYSQLND_PROTOCOL accordingly
This commit is contained in:
Andrey Hristov 2015-10-02 15:30:53 +02:00
parent 4c83582c74
commit 34a33928d6
12 changed files with 118 additions and 118 deletions

View file

@ -193,9 +193,9 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, dtor)(MYSQLND_CONN_DATA * conn)
conn->net = NULL; conn->net = NULL;
} }
if (conn->protocol) { if (conn->payload_decoder_factory) {
mysqlnd_protocol_free(conn->protocol); mysqlnd_protocol_payload_decoder_factory_free(conn->payload_decoder_factory);
conn->protocol = NULL; conn->payload_decoder_factory = NULL;
} }
if (conn->stats) { if (conn->stats) {
@ -222,7 +222,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_command_handle_response)(MYSQLND_CONN_DAT
switch (ok_packet) { switch (ok_packet) {
case PROT_OK_PACKET:{ case PROT_OK_PACKET:{
MYSQLND_PACKET_OK * ok_response = conn->protocol->m.get_ok_packet(conn->protocol, FALSE); MYSQLND_PACKET_OK * ok_response = conn->payload_decoder_factory->m.get_ok_packet(conn->payload_decoder_factory, FALSE);
if (!ok_response) { if (!ok_response) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
break; break;
@ -268,7 +268,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_command_handle_response)(MYSQLND_CONN_DAT
break; break;
} }
case PROT_EOF_PACKET:{ case PROT_EOF_PACKET:{
MYSQLND_PACKET_EOF * ok_response = conn->protocol->m.get_eof_packet(conn->protocol, FALSE); MYSQLND_PACKET_EOF * ok_response = conn->payload_decoder_factory->m.get_eof_packet(conn->payload_decoder_factory, FALSE);
if (!ok_response) { if (!ok_response) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
break; break;
@ -338,7 +338,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_command_do_request)(MYSQLND_CONN_DATA * c
SET_ERROR_AFF_ROWS(conn); SET_ERROR_AFF_ROWS(conn);
SET_EMPTY_ERROR(*conn->error_info); SET_EMPTY_ERROR(*conn->error_info);
cmd_packet = conn->protocol->m.get_command_packet(conn->protocol, FALSE); cmd_packet = conn->payload_decoder_factory->m.get_command_packet(conn->payload_decoder_factory, FALSE);
if (!cmd_packet) { if (!cmd_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL); DBG_RETURN(FAIL);
@ -473,7 +473,7 @@ mysqlnd_switch_to_ssl_if_needed(
DBG_INF_FMT("CLIENT_SSL_VERIFY_SERVER_CERT= %d", mysql_flags & CLIENT_SSL_VERIFY_SERVER_CERT? 1:0); DBG_INF_FMT("CLIENT_SSL_VERIFY_SERVER_CERT= %d", mysql_flags & CLIENT_SSL_VERIFY_SERVER_CERT? 1:0);
DBG_INF_FMT("CLIENT_REMEMBER_OPTIONS= %d", mysql_flags & CLIENT_REMEMBER_OPTIONS? 1:0); DBG_INF_FMT("CLIENT_REMEMBER_OPTIONS= %d", mysql_flags & CLIENT_REMEMBER_OPTIONS? 1:0);
auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE); auth_packet = conn->payload_decoder_factory->m.get_auth_packet(conn->payload_decoder_factory, FALSE);
if (!auth_packet) { if (!auth_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
goto end; goto end;
@ -800,7 +800,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
DBG_ENTER("mysqlnd_conn_data::connect_handshake"); DBG_ENTER("mysqlnd_conn_data::connect_handshake");
greet_packet = conn->protocol->m.get_greet_packet(conn->protocol, FALSE); greet_packet = conn->payload_decoder_factory->m.get_greet_packet(conn->payload_decoder_factory, FALSE);
if (!greet_packet) { if (!greet_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL); /* OOM */ DBG_RETURN(FAIL); /* OOM */
@ -1761,7 +1761,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_stri
if (FAIL == ret) { if (FAIL == ret) {
break; break;
} }
stats_header = conn->protocol->m.get_stats_packet(conn->protocol, FALSE); stats_header = conn->payload_decoder_factory->m.get_stats_packet(conn->payload_decoder_factory, FALSE);
if (!stats_header) { if (!stats_header) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
break; break;
@ -2983,9 +2983,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, init)(MYSQLND_CONN_DATA * conn)
SET_ERROR_AFF_ROWS(conn); SET_ERROR_AFF_ROWS(conn);
conn->net = mysqlnd_net_init(conn->persistent, conn->stats, conn->error_info); conn->net = mysqlnd_net_init(conn->persistent, conn->stats, conn->error_info);
conn->protocol = mysqlnd_protocol_init(conn->persistent); conn->payload_decoder_factory = mysqlnd_protocol_payload_decoder_factory_init(conn->persistent);
DBG_RETURN(conn->stats && conn->net && conn->protocol? PASS:FAIL); DBG_RETURN(conn->stats && conn->net && conn->payload_decoder_factory? PASS:FAIL);
} }
/* }}} */ /* }}} */

View file

@ -57,7 +57,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
DBG_ENTER("mysqlnd_auth_handshake"); DBG_ENTER("mysqlnd_auth_handshake");
auth_resp_packet = conn->protocol->m.get_auth_response_packet(conn->protocol, FALSE); auth_resp_packet = conn->payload_decoder_factory->m.get_auth_response_packet(conn->payload_decoder_factory, FALSE);
if (!auth_resp_packet) { if (!auth_resp_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
@ -65,7 +65,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
} }
if (use_full_blown_auth_packet != TRUE) { if (use_full_blown_auth_packet != TRUE) {
change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE); change_auth_resp_packet = conn->payload_decoder_factory->m.get_change_auth_response_packet(conn->payload_decoder_factory, FALSE);
if (!change_auth_resp_packet) { if (!change_auth_resp_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
goto end; goto end;
@ -80,7 +80,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
goto end; goto end;
} }
} else { } else {
auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE); auth_packet = conn->payload_decoder_factory->m.get_auth_packet(conn->payload_decoder_factory, FALSE);
auth_packet->client_flags = mysql_flags; auth_packet->client_flags = mysql_flags;
auth_packet->max_packet_size = session_options->max_allowed_packet; auth_packet->max_packet_size = session_options->max_allowed_packet;
@ -178,7 +178,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
DBG_ENTER("mysqlnd_auth_change_user"); DBG_ENTER("mysqlnd_auth_change_user");
chg_user_resp = conn->protocol->m.get_change_user_response_packet(conn->protocol, FALSE); chg_user_resp = conn->payload_decoder_factory->m.get_change_user_response_packet(conn->payload_decoder_factory, FALSE);
if (!chg_user_resp) { if (!chg_user_resp) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
@ -186,7 +186,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
} }
if (use_full_blown_auth_packet != TRUE) { if (use_full_blown_auth_packet != TRUE) {
change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE); change_auth_resp_packet = conn->payload_decoder_factory->m.get_change_auth_response_packet(conn->payload_decoder_factory, FALSE);
if (!change_auth_resp_packet) { if (!change_auth_resp_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
goto end; goto end;
@ -201,7 +201,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
goto end; goto end;
} }
} else { } else {
auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE); auth_packet = conn->payload_decoder_factory->m.get_auth_packet(conn->payload_decoder_factory, FALSE);
if (!auth_packet) { if (!auth_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
@ -260,7 +260,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
When it gets fixed, there should be one more check here When it gets fixed, there should be one more check here
*/ */
if (conn->m->get_server_version(conn) > 50113L &&conn->m->get_server_version(conn) < 50118L) { if (conn->m->get_server_version(conn) > 50113L &&conn->m->get_server_version(conn) < 50118L) {
MYSQLND_PACKET_OK * redundant_error_packet = conn->protocol->m.get_ok_packet(conn->protocol, FALSE); MYSQLND_PACKET_OK * redundant_error_packet = conn->payload_decoder_factory->m.get_ok_packet(conn->payload_decoder_factory, FALSE);
if (redundant_error_packet) { if (redundant_error_packet) {
PACKET_READ(redundant_error_packet, conn); PACKET_READ(redundant_error_packet, conn);
PACKET_FREE(redundant_error_packet); PACKET_FREE(redundant_error_packet);
@ -499,12 +499,12 @@ mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn,
do { do {
DBG_INF("requesting the public key from the server"); DBG_INF("requesting the public key from the server");
pk_req_packet = conn->protocol->m.get_sha256_pk_request_packet(conn->protocol, FALSE); pk_req_packet = conn->payload_decoder_factory->m.get_sha256_pk_request_packet(conn->payload_decoder_factory, FALSE);
if (!pk_req_packet) { if (!pk_req_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
break; break;
} }
pk_resp_packet = conn->protocol->m.get_sha256_pk_request_response_packet(conn->protocol, FALSE); pk_resp_packet = conn->payload_decoder_factory->m.get_sha256_pk_request_response_packet(conn->payload_decoder_factory, FALSE);
if (!pk_resp_packet) { if (!pk_resp_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
PACKET_FREE(pk_req_packet); PACKET_FREE(pk_req_packet);

View file

@ -282,18 +282,18 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYS
/* }}} */ /* }}} */
/* {{{ mysqlnd_object_factory::get_protocol_decoder */ /* {{{ mysqlnd_object_factory::get_protocol_payload_decoder_factory */
static MYSQLND_PROTOCOL * static MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY *
MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_decoder)(zend_bool persistent) MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_payload_decoder_factory)(zend_bool persistent)
{ {
size_t alloc_size = sizeof(MYSQLND_PROTOCOL) + mysqlnd_plugin_count() * sizeof(void *); size_t alloc_size = sizeof(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_PROTOCOL *ret = mnd_pecalloc(1, alloc_size, persistent); MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY *ret = mnd_pecalloc(1, alloc_size, persistent);
DBG_ENTER("mysqlnd_object_factory::get_protocol_decoder"); DBG_ENTER("mysqlnd_object_factory::get_protocol_payload_decoder_factory");
DBG_INF_FMT("persistent=%u", persistent); DBG_INF_FMT("persistent=%u", persistent);
if (ret) { if (ret) {
ret->persistent = persistent; ret->persistent = persistent;
ret->m = mysqlnd_mysqlnd_protocol_methods; ret->m = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_protocol_payload_decoder_factory);
} }
DBG_RETURN(ret); DBG_RETURN(ret);
@ -306,7 +306,7 @@ PHPAPI MYSQLND_CLASS_METHODS_START(mysqlnd_object_factory)
MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object), MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object),
MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement), MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement),
MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel), MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel),
MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_decoder) MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_payload_decoder_factory)
MYSQLND_CLASS_METHODS_END; MYSQLND_CLASS_METHODS_END;
/* /*

View file

@ -110,14 +110,14 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_R
/* {{{ _mysqlnd_plugin_get_plugin_protocol_data */ /* {{{ _mysqlnd_plugin_get_plugin_protocol_data */
PHPAPI void ** PHPAPI void **
_mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id) _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * factory, unsigned int plugin_id)
{ {
DBG_ENTER("_mysqlnd_plugin_get_plugin_protocol_data"); DBG_ENTER("_mysqlnd_plugin_get_plugin_protocol_data");
DBG_INF_FMT("plugin_id=%u", plugin_id); DBG_INF_FMT("plugin_id=%u", plugin_id);
if (!protocol || plugin_id >= mysqlnd_plugin_count()) { if (!factory || plugin_id >= mysqlnd_plugin_count()) {
return NULL; return NULL;
} }
DBG_RETURN((void *)((char *)protocol + sizeof(MYSQLND_PROTOCOL) + plugin_id * sizeof(void *))); DBG_RETURN((void *)((char *)factory + sizeof(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY) + plugin_id * sizeof(void *)));
} }
/* }}} */ /* }}} */
@ -253,20 +253,20 @@ mysqlnd_stmt_set_methods(struct st_mysqlnd_stmt_methods *methods)
/* }}} */ /* }}} */
/* {{{ mysqlnd_protocol_get_methods */ /* {{{ mysqlnd_protocol_payload_decoder_factory_get_methods */
PHPAPI struct st_mysqlnd_protocol_methods * PHPAPI struct st_mysqlnd_protocol_payload_decoder_factory_methods *
mysqlnd_protocol_get_methods() mysqlnd_protocol_payload_decoder_factory_get_methods()
{ {
return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_protocol); return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_protocol_payload_decoder_factory);
} }
/* }}} */ /* }}} */
/* {{{ mysqlnd_protocol_set_methods */ /* {{{ mysqlnd_protocol_payload_decoder_factory_set_methods */
PHPAPI void PHPAPI void
mysqlnd_protocol_set_methods(struct st_mysqlnd_protocol_methods * methods) mysqlnd_protocol_payload_decoder_factory_set_methods(struct st_mysqlnd_protocol_payload_decoder_factory_methods * methods)
{ {
MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_protocol) = *methods; MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_protocol_payload_decoder_factory) = *methods;
} }
/* }}} */ /* }}} */

View file

@ -43,7 +43,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_R
PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id); PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id);
#define mysqlnd_plugin_get_plugin_stmt_data(s, p_id) _mysqlnd_plugin_get_plugin_stmt_data((s), (p_id)) #define mysqlnd_plugin_get_plugin_stmt_data(s, p_id) _mysqlnd_plugin_get_plugin_stmt_data((s), (p_id))
PHPAPI void ** _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id); PHPAPI void ** _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * factory, unsigned int plugin_id);
#define mysqlnd_plugin_get_plugin_protocol_data(p, p_id) _mysqlnd_plugin_get_plugin_protocol_data((p), (p_id)) #define mysqlnd_plugin_get_plugin_protocol_data(p, p_id) _mysqlnd_plugin_get_plugin_protocol_data((p), (p_id))
PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id); PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id);

View file

@ -179,7 +179,7 @@ PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_conn_data);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_res); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_res);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_result_unbuffered); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_result_unbuffered);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_result_buffered); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_result_buffered);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol_payload_decoder_factory);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_net); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_net);
enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning); enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning);

View file

@ -265,12 +265,12 @@ mysqlnd_stmt_skip_metadata(MYSQLND_STMT * s)
MYSQLND_PACKET_RES_FIELD * field_packet; MYSQLND_PACKET_RES_FIELD * field_packet;
DBG_ENTER("mysqlnd_stmt_skip_metadata"); DBG_ENTER("mysqlnd_stmt_skip_metadata");
if (!stmt || !stmt->conn || !stmt->conn->protocol) { if (!stmt || !stmt->conn || !stmt->conn->payload_decoder_factory) {
DBG_RETURN(FAIL); DBG_RETURN(FAIL);
} }
DBG_INF_FMT("stmt=%lu", stmt->stmt_id); DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
field_packet = stmt->conn->protocol->m.get_result_field_packet(stmt->conn->protocol, FALSE); field_packet = stmt->conn->payload_decoder_factory->m.get_result_field_packet(stmt->conn->payload_decoder_factory, FALSE);
if (!field_packet) { if (!field_packet) {
SET_OOM_ERROR(*stmt->error_info); SET_OOM_ERROR(*stmt->error_info);
SET_OOM_ERROR(*stmt->conn->error_info); SET_OOM_ERROR(*stmt->conn->error_info);
@ -300,12 +300,12 @@ mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s)
enum_func_status ret = FAIL; enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_stmt_read_prepare_response"); DBG_ENTER("mysqlnd_stmt_read_prepare_response");
if (!stmt || !stmt->conn || !stmt->conn->protocol) { if (!stmt || !stmt->conn || !stmt->conn->payload_decoder_factory) {
DBG_RETURN(FAIL); DBG_RETURN(FAIL);
} }
DBG_INF_FMT("stmt=%lu", stmt->stmt_id); DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
prepare_resp = stmt->conn->protocol->m.get_prepare_response_packet(stmt->conn->protocol, FALSE); prepare_resp = stmt->conn->payload_decoder_factory->m.get_prepare_response_packet(stmt->conn->payload_decoder_factory, FALSE);
if (!prepare_resp) { if (!prepare_resp) {
SET_OOM_ERROR(*stmt->error_info); SET_OOM_ERROR(*stmt->error_info);
SET_OOM_ERROR(*stmt->conn->error_info); SET_OOM_ERROR(*stmt->conn->error_info);
@ -344,12 +344,12 @@ mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s)
enum_func_status ret = FAIL; enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_stmt_prepare_read_eof"); DBG_ENTER("mysqlnd_stmt_prepare_read_eof");
if (!stmt || !stmt->conn || !stmt->conn->protocol) { if (!stmt || !stmt->conn || !stmt->conn->payload_decoder_factory) {
DBG_RETURN(FAIL); DBG_RETURN(FAIL);
} }
DBG_INF_FMT("stmt=%lu", stmt->stmt_id); DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
fields_eof = stmt->conn->protocol->m.get_eof_packet(stmt->conn->protocol, FALSE); fields_eof = stmt->conn->payload_decoder_factory->m.get_eof_packet(stmt->conn->payload_decoder_factory, FALSE);
if (!fields_eof) { if (!fields_eof) {
SET_OOM_ERROR(*stmt->error_info); SET_OOM_ERROR(*stmt->error_info);
SET_OOM_ERROR(*stmt->conn->error_info); SET_OOM_ERROR(*stmt->conn->error_info);

View file

@ -411,7 +411,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s)
ret = FAIL; ret = FAIL;
do { do {
rset_header = conn->protocol->m.get_rset_header_packet(conn->protocol, FALSE); rset_header = conn->payload_decoder_factory->m.get_rset_header_packet(conn->payload_decoder_factory, FALSE);
if (!rset_header) { if (!rset_header) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
ret = FAIL; ret = FAIL;
@ -542,7 +542,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s)
} }
/* Check for SERVER_STATUS_MORE_RESULTS if needed */ /* Check for SERVER_STATUS_MORE_RESULTS if needed */
fields_eof = conn->protocol->m.get_eof_packet(conn->protocol, FALSE); fields_eof = conn->payload_decoder_factory->m.get_eof_packet(conn->payload_decoder_factory, FALSE);
if (!fields_eof) { if (!fields_eof) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
ret = FAIL; ret = FAIL;
@ -944,7 +944,7 @@ MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps
this to be not NULL. this to be not NULL.
*/ */
/* FALSE = non-persistent */ /* FALSE = non-persistent */
result->unbuf->row_packet = result->conn->protocol->m.get_row_packet(result->conn->protocol, FALSE); result->unbuf->row_packet = result->conn->payload_decoder_factory->m.get_row_packet(result->conn->payload_decoder_factory, FALSE);
if (!result->unbuf->row_packet) { if (!result->unbuf->row_packet) {
goto oom; goto oom;
} }
@ -1295,7 +1295,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c
set->references = 1; set->references = 1;
/* non-persistent */ /* non-persistent */
row_packet = conn->protocol->m.get_row_packet(conn->protocol, FALSE); row_packet = conn->payload_decoder_factory->m.get_row_packet(conn->payload_decoder_factory, FALSE);
if (!row_packet) { if (!row_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
ret = FAIL; ret = FAIL;

View file

@ -57,7 +57,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
DBG_ENTER("mysqlnd_res_meta::read_metadata"); DBG_ENTER("mysqlnd_res_meta::read_metadata");
field_packet = conn->protocol->m.get_result_field_packet(conn->protocol, FALSE); field_packet = conn->payload_decoder_factory->m.get_result_field_packet(conn->payload_decoder_factory, FALSE);
if (!field_packet) { if (!field_packet) {
SET_OOM_ERROR(*conn->error_info); SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL); DBG_RETURN(FAIL);

View file

@ -224,7 +224,7 @@ typedef struct st_mysqlnd_connection MYSQLND;
typedef struct st_mysqlnd_connection_data MYSQLND_CONN_DATA; typedef struct st_mysqlnd_connection_data MYSQLND_CONN_DATA;
typedef struct st_mysqlnd_net MYSQLND_NET; typedef struct st_mysqlnd_net MYSQLND_NET;
typedef struct st_mysqlnd_net_data MYSQLND_NET_DATA; typedef struct st_mysqlnd_net_data MYSQLND_NET_DATA;
typedef struct st_mysqlnd_protocol MYSQLND_PROTOCOL; typedef struct st_mysqlnd_protocol_payload_decoder_factory MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY;
typedef struct st_mysqlnd_res MYSQLND_RES; typedef struct st_mysqlnd_res MYSQLND_RES;
typedef char** MYSQLND_ROW_C; /* return data as array of strings */ typedef char** MYSQLND_ROW_C; /* return data as array of strings */
typedef struct st_mysqlnd_stmt_data MYSQLND_STMT_DATA; typedef struct st_mysqlnd_stmt_data MYSQLND_STMT_DATA;
@ -357,39 +357,39 @@ struct st_mysqlnd_packet_auth_pam;
struct st_mysqlnd_packet_sha256_pk_request; struct st_mysqlnd_packet_sha256_pk_request;
struct st_mysqlnd_packet_sha256_pk_request_response; struct st_mysqlnd_packet_sha256_pk_request_response;
typedef struct st_mysqlnd_packet_greet * (*func_mysqlnd_protocol__get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_greet * (*func_mysqlnd_protocol_payload_decoder_factory__get_greet_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_auth * (*func_mysqlnd_protocol__get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_auth * (*func_mysqlnd_protocol_payload_decoder_factory__get_auth_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_auth_response *(*func_mysqlnd_protocol__get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_auth_response *(*func_mysqlnd_protocol_payload_decoder_factory__get_auth_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_change_auth_response * (*func_mysqlnd_protocol__get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_change_auth_response * (*func_mysqlnd_protocol_payload_decoder_factory__get_change_auth_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_ok * (*func_mysqlnd_protocol__get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_ok * (*func_mysqlnd_protocol_payload_decoder_factory__get_ok_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_command * (*func_mysqlnd_protocol__get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_command * (*func_mysqlnd_protocol_payload_decoder_factory__get_command_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_eof * (*func_mysqlnd_protocol__get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_eof * (*func_mysqlnd_protocol_payload_decoder_factory__get_eof_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_rset_header * (*func_mysqlnd_protocol__get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_rset_header * (*func_mysqlnd_protocol_payload_decoder_factory__get_rset_header_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_res_field * (*func_mysqlnd_protocol__get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_res_field * (*func_mysqlnd_protocol_payload_decoder_factory__get_result_field_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_row * (*func_mysqlnd_protocol__get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_row * (*func_mysqlnd_protocol_payload_decoder_factory__get_row_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_stats * (*func_mysqlnd_protocol__get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_stats * (*func_mysqlnd_protocol_payload_decoder_factory__get_stats_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_prepare_response *(*func_mysqlnd_protocol__get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_prepare_response *(*func_mysqlnd_protocol_payload_decoder_factory__get_prepare_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_chg_user_resp*(*func_mysqlnd_protocol__get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_chg_user_resp*(*func_mysqlnd_protocol_payload_decoder_factory__get_change_user_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_sha256_pk_request *(*func_mysqlnd_protocol__get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_sha256_pk_request *(*func_mysqlnd_protocol_payload_decoder_factory__get_sha256_pk_request_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
typedef struct st_mysqlnd_packet_sha256_pk_request_response *(*func_mysqlnd_protocol__get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent); typedef struct st_mysqlnd_packet_sha256_pk_request_response *(*func_mysqlnd_protocol_payload_decoder_factory__get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent);
struct st_mysqlnd_protocol_methods struct st_mysqlnd_protocol_payload_decoder_factory_methods
{ {
func_mysqlnd_protocol__get_greet_packet get_greet_packet; func_mysqlnd_protocol_payload_decoder_factory__get_greet_packet get_greet_packet;
func_mysqlnd_protocol__get_auth_packet get_auth_packet; func_mysqlnd_protocol_payload_decoder_factory__get_auth_packet get_auth_packet;
func_mysqlnd_protocol__get_auth_response_packet get_auth_response_packet; func_mysqlnd_protocol_payload_decoder_factory__get_auth_response_packet get_auth_response_packet;
func_mysqlnd_protocol__get_change_auth_response_packet get_change_auth_response_packet; func_mysqlnd_protocol_payload_decoder_factory__get_change_auth_response_packet get_change_auth_response_packet;
func_mysqlnd_protocol__get_ok_packet get_ok_packet; func_mysqlnd_protocol_payload_decoder_factory__get_ok_packet get_ok_packet;
func_mysqlnd_protocol__get_command_packet get_command_packet; func_mysqlnd_protocol_payload_decoder_factory__get_command_packet get_command_packet;
func_mysqlnd_protocol__get_eof_packet get_eof_packet; func_mysqlnd_protocol_payload_decoder_factory__get_eof_packet get_eof_packet;
func_mysqlnd_protocol__get_rset_header_packet get_rset_header_packet; func_mysqlnd_protocol_payload_decoder_factory__get_rset_header_packet get_rset_header_packet;
func_mysqlnd_protocol__get_result_field_packet get_result_field_packet; func_mysqlnd_protocol_payload_decoder_factory__get_result_field_packet get_result_field_packet;
func_mysqlnd_protocol__get_row_packet get_row_packet; func_mysqlnd_protocol_payload_decoder_factory__get_row_packet get_row_packet;
func_mysqlnd_protocol__get_stats_packet get_stats_packet; func_mysqlnd_protocol_payload_decoder_factory__get_stats_packet get_stats_packet;
func_mysqlnd_protocol__get_prepare_response_packet get_prepare_response_packet; func_mysqlnd_protocol_payload_decoder_factory__get_prepare_response_packet get_prepare_response_packet;
func_mysqlnd_protocol__get_change_user_response_packet get_change_user_response_packet; func_mysqlnd_protocol_payload_decoder_factory__get_change_user_response_packet get_change_user_response_packet;
func_mysqlnd_protocol__get_sha256_pk_request_packet get_sha256_pk_request_packet; func_mysqlnd_protocol_payload_decoder_factory__get_sha256_pk_request_packet get_sha256_pk_request_packet;
func_mysqlnd_protocol__get_sha256_pk_request_response_packet get_sha256_pk_request_response_packet; func_mysqlnd_protocol_payload_decoder_factory__get_sha256_pk_request_response_packet get_sha256_pk_request_response_packet;
void * unused1; void * unused1;
void * unused2; void * unused2;
@ -401,7 +401,7 @@ typedef MYSQLND * (*func_mysqlnd_object_factory__get_connection)(zend_bool persi
typedef MYSQLND * (*func_mysqlnd_object_factory__clone_connection_object)(MYSQLND * conn); typedef MYSQLND * (*func_mysqlnd_object_factory__clone_connection_object)(MYSQLND * conn);
typedef MYSQLND_STMT * (*func_mysqlnd_object_factory__get_prepared_statement)(MYSQLND_CONN_DATA * conn); typedef MYSQLND_STMT * (*func_mysqlnd_object_factory__get_prepared_statement)(MYSQLND_CONN_DATA * conn);
typedef MYSQLND_NET * (*func_mysqlnd_object_factory__get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info); typedef MYSQLND_NET * (*func_mysqlnd_object_factory__get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
typedef MYSQLND_PROTOCOL * (*func_mysqlnd_object_factory__get_protocol_decoder)(zend_bool persistent); typedef MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * (*func_mysqlnd_object_factory__get_protocol_payload_decoder_factory)(zend_bool persistent);
struct st_mysqlnd_object_factory_methods struct st_mysqlnd_object_factory_methods
@ -410,7 +410,7 @@ struct st_mysqlnd_object_factory_methods
func_mysqlnd_object_factory__clone_connection_object clone_connection_object; func_mysqlnd_object_factory__clone_connection_object clone_connection_object;
func_mysqlnd_object_factory__get_prepared_statement get_prepared_statement; func_mysqlnd_object_factory__get_prepared_statement get_prepared_statement;
func_mysqlnd_object_factory__get_io_channel get_io_channel; func_mysqlnd_object_factory__get_io_channel get_io_channel;
func_mysqlnd_object_factory__get_protocol_decoder get_protocol_decoder; func_mysqlnd_object_factory__get_protocol_payload_decoder_factory get_protocol_payload_decoder_factory;
}; };
@ -892,10 +892,10 @@ struct st_mysqlnd_net
}; };
struct st_mysqlnd_protocol struct st_mysqlnd_protocol_payload_decoder_factory
{ {
zend_bool persistent; zend_bool persistent;
struct st_mysqlnd_protocol_methods m; struct st_mysqlnd_protocol_payload_decoder_factory_methods m;
}; };
@ -903,7 +903,7 @@ struct st_mysqlnd_connection_data
{ {
/* Operation related */ /* Operation related */
MYSQLND_NET * net; MYSQLND_NET * net;
MYSQLND_PROTOCOL * protocol; MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * payload_decoder_factory;
/* Information related */ /* Information related */
char *host; char *host;

View file

@ -2304,7 +2304,7 @@ mysqlnd_packet_methods packet_methods[PROT_LAST] =
/* {{{ mysqlnd_protocol::get_greet_packet */ /* {{{ mysqlnd_protocol::get_greet_packet */
static struct st_mysqlnd_packet_greet * static struct st_mysqlnd_packet_greet *
MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_greet * packet = mnd_pecalloc(1, packet_methods[PROT_GREET_PACKET].struct_size, persistent); struct st_mysqlnd_packet_greet * packet = mnd_pecalloc(1, packet_methods[PROT_GREET_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_greet_packet"); DBG_ENTER("mysqlnd_protocol::get_greet_packet");
@ -2319,7 +2319,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet)(MYSQLND_PROTOCOL * const prot
/* {{{ mysqlnd_protocol::get_auth_packet */ /* {{{ mysqlnd_protocol::get_auth_packet */
static struct st_mysqlnd_packet_auth * static struct st_mysqlnd_packet_auth *
MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_auth * packet = mnd_pecalloc(1, packet_methods[PROT_AUTH_PACKET].struct_size, persistent); struct st_mysqlnd_packet_auth * packet = mnd_pecalloc(1, packet_methods[PROT_AUTH_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_auth_packet"); DBG_ENTER("mysqlnd_protocol::get_auth_packet");
@ -2334,7 +2334,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet)(MYSQLND_PROTOCOL * const proto
/* {{{ mysqlnd_protocol::get_auth_response_packet */ /* {{{ mysqlnd_protocol::get_auth_response_packet */
static struct st_mysqlnd_packet_auth_response * static struct st_mysqlnd_packet_auth_response *
MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_auth_response * packet = mnd_pecalloc(1, packet_methods[PROT_AUTH_RESP_PACKET].struct_size, persistent); struct st_mysqlnd_packet_auth_response * packet = mnd_pecalloc(1, packet_methods[PROT_AUTH_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_auth_response_packet"); DBG_ENTER("mysqlnd_protocol::get_auth_response_packet");
@ -2349,7 +2349,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet)(MYSQLND_PROTOCOL * co
/* {{{ mysqlnd_protocol::get_change_auth_response_packet */ /* {{{ mysqlnd_protocol::get_change_auth_response_packet */
static struct st_mysqlnd_packet_change_auth_response * static struct st_mysqlnd_packet_change_auth_response *
MYSQLND_METHOD(mysqlnd_protocol, get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_change_auth_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_change_auth_response * packet = mnd_pecalloc(1, packet_methods[PROT_CHANGE_AUTH_RESP_PACKET].struct_size, persistent); struct st_mysqlnd_packet_change_auth_response * packet = mnd_pecalloc(1, packet_methods[PROT_CHANGE_AUTH_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_change_auth_response_packet"); DBG_ENTER("mysqlnd_protocol::get_change_auth_response_packet");
@ -2364,7 +2364,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_change_auth_response_packet)(MYSQLND_PROTOC
/* {{{ mysqlnd_protocol::get_ok_packet */ /* {{{ mysqlnd_protocol::get_ok_packet */
static struct st_mysqlnd_packet_ok * static struct st_mysqlnd_packet_ok *
MYSQLND_METHOD(mysqlnd_protocol, get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_ok_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_ok * packet = mnd_pecalloc(1, packet_methods[PROT_OK_PACKET].struct_size, persistent); struct st_mysqlnd_packet_ok * packet = mnd_pecalloc(1, packet_methods[PROT_OK_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_ok_packet"); DBG_ENTER("mysqlnd_protocol::get_ok_packet");
@ -2379,7 +2379,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_ok_packet)(MYSQLND_PROTOCOL * const protoco
/* {{{ mysqlnd_protocol::get_eof_packet */ /* {{{ mysqlnd_protocol::get_eof_packet */
static struct st_mysqlnd_packet_eof * static struct st_mysqlnd_packet_eof *
MYSQLND_METHOD(mysqlnd_protocol, get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_eof_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_eof * packet = mnd_pecalloc(1, packet_methods[PROT_EOF_PACKET].struct_size, persistent); struct st_mysqlnd_packet_eof * packet = mnd_pecalloc(1, packet_methods[PROT_EOF_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_eof_packet"); DBG_ENTER("mysqlnd_protocol::get_eof_packet");
@ -2394,7 +2394,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_eof_packet)(MYSQLND_PROTOCOL * const protoc
/* {{{ mysqlnd_protocol::get_command_packet */ /* {{{ mysqlnd_protocol::get_command_packet */
static struct st_mysqlnd_packet_command * static struct st_mysqlnd_packet_command *
MYSQLND_METHOD(mysqlnd_protocol, get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_command_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_command * packet = mnd_pecalloc(1, packet_methods[PROT_CMD_PACKET].struct_size, persistent); struct st_mysqlnd_packet_command * packet = mnd_pecalloc(1, packet_methods[PROT_CMD_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_command_packet"); DBG_ENTER("mysqlnd_protocol::get_command_packet");
@ -2409,7 +2409,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_command_packet)(MYSQLND_PROTOCOL * const pr
/* {{{ mysqlnd_protocol::get_rset_packet */ /* {{{ mysqlnd_protocol::get_rset_packet */
static struct st_mysqlnd_packet_rset_header * static struct st_mysqlnd_packet_rset_header *
MYSQLND_METHOD(mysqlnd_protocol, get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_rset_header_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_rset_header * packet = mnd_pecalloc(1, packet_methods[PROT_RSET_HEADER_PACKET].struct_size, persistent); struct st_mysqlnd_packet_rset_header * packet = mnd_pecalloc(1, packet_methods[PROT_RSET_HEADER_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_rset_header_packet"); DBG_ENTER("mysqlnd_protocol::get_rset_header_packet");
@ -2424,7 +2424,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_rset_header_packet)(MYSQLND_PROTOCOL * cons
/* {{{ mysqlnd_protocol::get_result_field_packet */ /* {{{ mysqlnd_protocol::get_result_field_packet */
static struct st_mysqlnd_packet_res_field * static struct st_mysqlnd_packet_res_field *
MYSQLND_METHOD(mysqlnd_protocol, get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_result_field_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_res_field * packet = mnd_pecalloc(1, packet_methods[PROT_RSET_FLD_PACKET].struct_size, persistent); struct st_mysqlnd_packet_res_field * packet = mnd_pecalloc(1, packet_methods[PROT_RSET_FLD_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_result_field_packet"); DBG_ENTER("mysqlnd_protocol::get_result_field_packet");
@ -2439,7 +2439,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_result_field_packet)(MYSQLND_PROTOCOL * con
/* {{{ mysqlnd_protocol::get_row_packet */ /* {{{ mysqlnd_protocol::get_row_packet */
static struct st_mysqlnd_packet_row * static struct st_mysqlnd_packet_row *
MYSQLND_METHOD(mysqlnd_protocol, get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_row_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_row * packet = mnd_pecalloc(1, packet_methods[PROT_ROW_PACKET].struct_size, persistent); struct st_mysqlnd_packet_row * packet = mnd_pecalloc(1, packet_methods[PROT_ROW_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_row_packet"); DBG_ENTER("mysqlnd_protocol::get_row_packet");
@ -2454,7 +2454,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_row_packet)(MYSQLND_PROTOCOL * const protoc
/* {{{ mysqlnd_protocol::get_stats_packet */ /* {{{ mysqlnd_protocol::get_stats_packet */
static struct st_mysqlnd_packet_stats * static struct st_mysqlnd_packet_stats *
MYSQLND_METHOD(mysqlnd_protocol, get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_stats_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_stats * packet = mnd_pecalloc(1, packet_methods[PROT_STATS_PACKET].struct_size, persistent); struct st_mysqlnd_packet_stats * packet = mnd_pecalloc(1, packet_methods[PROT_STATS_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_stats_packet"); DBG_ENTER("mysqlnd_protocol::get_stats_packet");
@ -2469,7 +2469,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_stats_packet)(MYSQLND_PROTOCOL * const prot
/* {{{ mysqlnd_protocol::get_prepare_response_packet */ /* {{{ mysqlnd_protocol::get_prepare_response_packet */
static struct st_mysqlnd_packet_prepare_response * static struct st_mysqlnd_packet_prepare_response *
MYSQLND_METHOD(mysqlnd_protocol, get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_prepare_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_prepare_response * packet = mnd_pecalloc(1, packet_methods[PROT_PREPARE_RESP_PACKET].struct_size, persistent); struct st_mysqlnd_packet_prepare_response * packet = mnd_pecalloc(1, packet_methods[PROT_PREPARE_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_prepare_response_packet"); DBG_ENTER("mysqlnd_protocol::get_prepare_response_packet");
@ -2484,7 +2484,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_prepare_response_packet)(MYSQLND_PROTOCOL *
/* {{{ mysqlnd_protocol::get_change_user_response_packet */ /* {{{ mysqlnd_protocol::get_change_user_response_packet */
static struct st_mysqlnd_packet_chg_user_resp* static struct st_mysqlnd_packet_chg_user_resp*
MYSQLND_METHOD(mysqlnd_protocol, get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_change_user_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_chg_user_resp * packet = mnd_pecalloc(1, packet_methods[PROT_CHG_USER_RESP_PACKET].struct_size, persistent); struct st_mysqlnd_packet_chg_user_resp * packet = mnd_pecalloc(1, packet_methods[PROT_CHG_USER_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_change_user_response_packet"); DBG_ENTER("mysqlnd_protocol::get_change_user_response_packet");
@ -2499,7 +2499,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_change_user_response_packet)(MYSQLND_PROTOC
/* {{{ mysqlnd_protocol::get_sha256_pk_request_packet */ /* {{{ mysqlnd_protocol::get_sha256_pk_request_packet */
static struct st_mysqlnd_packet_sha256_pk_request * static struct st_mysqlnd_packet_sha256_pk_request *
MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_sha256_pk_request * packet = mnd_pecalloc(1, packet_methods[PROT_SHA256_PK_REQUEST_PACKET].struct_size, persistent); struct st_mysqlnd_packet_sha256_pk_request * packet = mnd_pecalloc(1, packet_methods[PROT_SHA256_PK_REQUEST_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_sha256_pk_request_packet"); DBG_ENTER("mysqlnd_protocol::get_sha256_pk_request_packet");
@ -2514,7 +2514,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL
/* {{{ mysqlnd_protocol::get_sha256_pk_request_response_packet */ /* {{{ mysqlnd_protocol::get_sha256_pk_request_response_packet */
static struct st_mysqlnd_packet_sha256_pk_request_response * static struct st_mysqlnd_packet_sha256_pk_request_response *
MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent) MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent)
{ {
struct st_mysqlnd_packet_sha256_pk_request_response * packet = mnd_pecalloc(1, packet_methods[PROT_SHA256_PK_REQUEST_RESPONSE_PACKET].struct_size, persistent); struct st_mysqlnd_packet_sha256_pk_request_response * packet = mnd_pecalloc(1, packet_methods[PROT_SHA256_PK_REQUEST_RESPONSE_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_sha256_pk_request_response_packet"); DBG_ENTER("mysqlnd_protocol::get_sha256_pk_request_response_packet");
@ -2528,7 +2528,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_response_packet)(MYSQLND_
MYSQLND_CLASS_METHODS_START(mysqlnd_protocol) MYSQLND_CLASS_METHODS_START(mysqlnd_protocol_payload_decoder_factory)
MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet), MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet),
MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet), MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet),
MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet), MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet),
@ -2547,27 +2547,27 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_protocol)
MYSQLND_CLASS_METHODS_END; MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_protocol_init */ /* {{{ mysqlnd_protocol_payload_decoder_factory_init */
PHPAPI MYSQLND_PROTOCOL * PHPAPI MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY *
mysqlnd_protocol_init(zend_bool persistent) mysqlnd_protocol_payload_decoder_factory_init(zend_bool persistent)
{ {
MYSQLND_PROTOCOL * ret; MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * ret;
DBG_ENTER("mysqlnd_protocol_init"); DBG_ENTER("mysqlnd_protocol_payload_decoder_factory_init");
ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_protocol_decoder(persistent); ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_protocol_payload_decoder_factory(persistent);
DBG_RETURN(ret); DBG_RETURN(ret);
} }
/* }}} */ /* }}} */
/* {{{ mysqlnd_protocol_free */ /* {{{ mysqlnd_protocol_payload_decoder_factory_free */
PHPAPI void PHPAPI void
mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol) mysqlnd_protocol_payload_decoder_factory_free(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory)
{ {
DBG_ENTER("mysqlnd_protocol_free"); DBG_ENTER("mysqlnd_protocol_payload_decoder_factory_free");
if (protocol) { if (factory) {
zend_bool pers = protocol->persistent; zend_bool pers = factory->persistent;
mnd_pefree(protocol, pers); mnd_pefree(factory, pers);
} }
DBG_VOID_RETURN; DBG_VOID_RETURN;
} }

View file

@ -320,8 +320,8 @@ enum_func_status php_mysqlnd_rowp_read_text_protocol_c(MYSQLND_MEMORY_POOL_CHUNK
zend_bool as_int_or_float, MYSQLND_STATS * stats); zend_bool as_int_or_float, MYSQLND_STATS * stats);
PHPAPI MYSQLND_PROTOCOL * mysqlnd_protocol_init(zend_bool persistent); PHPAPI MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * mysqlnd_protocol_payload_decoder_factory_init(zend_bool persistent);
PHPAPI void mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol); PHPAPI void mysqlnd_protocol_payload_decoder_factory_free(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const payload_decoder_factory);
#endif /* MYSQLND_WIREPROTOCOL_H */ #endif /* MYSQLND_WIREPROTOCOL_H */