From cfd868651a321fbfd84ed98e33669c5f94a7098a Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Mon, 12 Oct 2015 14:57:48 +0200 Subject: MDNR: - removed init() method from mysqlnd_conn_data and moved the initialization to the object factory->get_connection(). Now it is unified as with the prepared statement which doesn't have any init() method - the protocol decoder factory now takes connection as parameter at creation and thus there is no need to pass the connection as parameter when calling the read or the write method of a packet. - saved the protocol payload decoder factory as pointer in every packet (read/write) so the connection doesn't need to be passed on every call of read/write (dependency has been already injected at creation). This will alow to move protocol specific code from MYSQLND_NET (send_ex()) to make MYSQLND_NET leaner and free from protocol stuff. --- ext/mysqlnd/mysqlnd.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'ext/mysqlnd/mysqlnd.c') diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 3ca8b1114b..56f3396974 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2974,27 +2974,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end)(MYSQLND_CONN_DATA * conn, size_t /* }}} */ -/* {{{ mysqlnd_conn_data::init */ -static enum_func_status -MYSQLND_METHOD(mysqlnd_conn_data, init)(MYSQLND_CONN_DATA * conn) -{ - DBG_ENTER("mysqlnd_conn_data::init"); - mysqlnd_stats_init(&conn->stats, STAT_LAST, conn->persistent); - SET_ERROR_AFF_ROWS(conn); - - conn->net = mysqlnd_net_init(conn->persistent, conn->stats, conn->error_info); - conn->payload_decoder_factory = mysqlnd_protocol_payload_decoder_factory_init(conn->persistent); - - DBG_RETURN(conn->stats && conn->net && conn->payload_decoder_factory? PASS:FAIL); -} -/* }}} */ - - MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn); MYSQLND_CLASS_METHODS_START(mysqlnd_conn_data) - MYSQLND_METHOD(mysqlnd_conn_data, init), MYSQLND_METHOD(mysqlnd_conn_data, connect), MYSQLND_METHOD(mysqlnd_conn_data, escape_string), -- cgit v1.2.1