Skip to content
Snippets Groups Projects
Commit 42c7664e authored by Bogdan Bogush's avatar Bogdan Bogush Committed by Yalu Zhang
Browse files

Some improvement in rpc_handler_init() and rpc_handler_uninit()

Also correct an error in firewall rule event handler for voice.
parent 95a31623
Branches
No related tags found
1 merge request!43Fixed json rpc subscriptions uninit
Pipeline #132496 passed
...@@ -73,7 +73,7 @@ int subs_event_handler(const json_object *jmsg, int param_count, json_object *jr ...@@ -73,7 +73,7 @@ int subs_event_handler(const json_object *jmsg, int param_count, json_object *jr
return RETURN_ERR; return RETURN_ERR;
} }
if (!match(param_request.name, FIREWALL_RULE_DATA_SIP_PATTERN, 0, NULL) || if (!match(param_request.name, FIREWALL_RULE_DATA_SIP_PATTERN, 0, NULL) &&
!match(param_request.name, FIREWALL_RULE_DATA_RTP_PATTERN, 0, NULL)) { !match(param_request.name, FIREWALL_RULE_DATA_RTP_PATTERN, 0, NULL)) {
ret = RETURN_ERR; ret = RETURN_ERR;
WARNING("Unexpected event [%s][%d]", param_request.name, (int)param_request.type); WARNING("Unexpected event [%s][%d]", param_request.name, (int)param_request.type);
......
...@@ -52,7 +52,6 @@ int rpc_handler_init() ...@@ -52,7 +52,6 @@ int rpc_handler_init()
ERR("Failed to init HAL server"); ERR("Failed to init HAL server");
return -1; return -1;
} }
is_json_server_init_done = true;
if (json_hal_server_register_action_callback("setParameters", if (json_hal_server_register_action_callback("setParameters",
bbfdm_set_value) != RETURN_OK) { bbfdm_set_value) != RETURN_OK) {
...@@ -85,6 +84,8 @@ int rpc_handler_init() ...@@ -85,6 +84,8 @@ int rpc_handler_init()
goto Error; goto Error;
} }
is_json_server_init_done = true;
return 0; return 0;
Error: Error:
...@@ -95,11 +96,13 @@ Error: ...@@ -95,11 +96,13 @@ Error:
int rpc_handler_uninit() int rpc_handler_uninit()
{ {
if (is_json_server_init_done && json_hal_server_terminate() != RETURN_OK) { if (!is_json_server_init_done)
ERR("Failed to terminate HAL server"); return 0;
return -1;
}
is_json_server_init_done = false; is_json_server_init_done = false;
if (json_hal_server_terminate() != RETURN_OK)
ERR("Failed to terminate HAL server");
subs_event_uninit(); subs_event_uninit();
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment