pfc & vio init methods cannot fail

These methods cannot fail the way they are currently designed. They only
call set_client_option which could fail only with wrong arguments. Since
this is an internal call, the arguments should never change. Either way
set_client_option should not cause init to fail.
This commit is contained in:
Kamil Tekiela 2021-10-21 22:24:59 +01:00
parent ee510eed68
commit 45607225ea
4 changed files with 8 additions and 14 deletions

View file

@ -438,7 +438,7 @@ MYSQLND_METHOD(mysqlnd_pfc, free_contents)(MYSQLND_PFC * pfc)
/* {{{ mysqlnd_pfc::init */
static enum_func_status
static void
MYSQLND_METHOD(mysqlnd_pfc, init)(MYSQLND_PFC * const pfc, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
unsigned int buf_size;
@ -447,7 +447,7 @@ MYSQLND_METHOD(mysqlnd_pfc, init)(MYSQLND_PFC * const pfc, MYSQLND_STATS * const
buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is long, cast to unsigned int*/
pfc->data->m.set_client_option(pfc, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size);
DBG_RETURN(PASS);
DBG_VOID_RETURN;
}
/* }}} */