MOD aaa-12 优化getall函数参数,去除无用参数
SOL 优化getall函数参数,去除无用参数 修改人:zhangliang 检视人:zhangliang
This commit is contained in:
parent
4e4b782d7c
commit
14813701e8
|
@ -206,9 +206,7 @@ void cm_config_process(rpc_conn *conn, pointer input, int input_len, void* data)
|
||||||
char *cm_get_buff = NULL;
|
char *cm_get_buff = NULL;
|
||||||
ret_code ret = RET_OK;
|
ret_code ret = RET_OK;
|
||||||
int config_len = 0;
|
int config_len = 0;
|
||||||
short* single_len = NULL;
|
|
||||||
int buff_len = CM_BUFF_SIZE;
|
int buff_len = CM_BUFF_SIZE;
|
||||||
int index = 0, cnt = 0;
|
|
||||||
|
|
||||||
if(conn == NULL || input == NULL)
|
if(conn == NULL || input == NULL)
|
||||||
{
|
{
|
||||||
|
@ -286,24 +284,10 @@ void cm_config_process(rpc_conn *conn, pointer input, int input_len, void* data)
|
||||||
case CM_CONFIG_GET_ALL:
|
case CM_CONFIG_GET_ALL:
|
||||||
if(config_svr->getall_callback)
|
if(config_svr->getall_callback)
|
||||||
{
|
{
|
||||||
single_len = rpc_new(short, CM_BUFF_SIZE);
|
|
||||||
if(single_len == NULL)
|
|
||||||
{
|
|
||||||
rpc_return_error(conn, RET_NOMEM, "not enough memery");
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = config_svr->getall_callback(config_msg->source,
|
ret = config_svr->getall_callback(config_msg->source,
|
||||||
config_svr->config_id,
|
|
||||||
cm_get_buff,
|
cm_get_buff,
|
||||||
single_len,
|
&buff_len);
|
||||||
&cnt);
|
|
||||||
|
|
||||||
buff_len = 0;
|
|
||||||
for(index = 0 ; index < cnt; index++)
|
|
||||||
{
|
|
||||||
buff_len = buff_len + single_len[index];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -336,11 +320,6 @@ void cm_config_process(rpc_conn *conn, pointer input, int input_len, void* data)
|
||||||
exit:
|
exit:
|
||||||
rpc_free(cm_get_buff);
|
rpc_free(cm_get_buff);
|
||||||
|
|
||||||
if(single_len != NULL)
|
|
||||||
{
|
|
||||||
rpc_free(single_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue