From: wn.jang Date: Tue, 20 Sep 2022 11:46:23 +0000 (+0900) Subject: Add to disconnect rpc socket when client is finalized X-Git-Tag: accepted/tizen/unified/20220921.091827~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5963e3d8ccf43401b36bf8d62b9bf094aa4418e;p=platform%2Fcore%2Fuifw%2Fvoice-control.git Add to disconnect rpc socket when client is finalized Cause: __on_disconnection is called when engine is terminated due to no more clients. Change-Id: If3cfaa9c35ce8477e3c08e7d12c211d49e622c42 Solution: To avoid reconnect by service reset, disconnect rpc socket when client is finalized. --- diff --git a/client/vc_mgr_tidl.c b/client/vc_mgr_tidl.c index 94f3bd9..9757e1e 100644 --- a/client/vc_mgr_tidl.c +++ b/client/vc_mgr_tidl.c @@ -803,7 +803,18 @@ int vc_mgr_tidl_request_finalize(int pid) } if (VC_ERROR_NONE != ret) { - SLOG(LOG_ERROR, TAG_VCM, "[TIDL ERROR] Request vc manager finalize : Fail to invoke message, error(%d)", ret); + SLOG(LOG_ERROR, TAG_VCM, "[TIDL ERROR] Request vc manager finalize : Fail to invoke finalize, error(%d)", ret); + return ret; + } + + ret = rpc_port_proxy_vc_mgr_proxy_vc_mgr_disconnect(g_proxy_tidl_info->rpc_h); + exception = get_last_result(); + if (RPC_PORT_ERROR_NONE != exception) { + ret = __convert_unhandled_error(exception); + } + + if (VC_ERROR_NONE != ret) { + SLOG(LOG_ERROR, TAG_VCM, "[TIDL ERROR] Request vc manager finalize : Fail to disconnect, error(%d)", ret); return ret; } diff --git a/client/vc_tidl.c b/client/vc_tidl.c index 205ee2f..c92aa53 100644 --- a/client/vc_tidl.c +++ b/client/vc_tidl.c @@ -457,7 +457,18 @@ int vc_tidl_request_finalize(int pid) } if (VC_ERROR_NONE != ret) { - SLOG(LOG_ERROR, TAG_VCC, ">>>> Request vc finalize : Fail to invoke message. err(%d)", ret); + SLOG(LOG_ERROR, TAG_VCC, ">>>> Request vc finalize : Fail to invoke finalize. err(%d)", ret); + return ret; + } + + ret = rpc_port_proxy_vc_proxy_vc_disconnect(info->rpc_h); + exception = get_last_result(); + if (RPC_PORT_ERROR_NONE != exception) { + ret = __convert_unhandled_error(exception); + } + + if (VC_ERROR_NONE != ret) { + SLOG(LOG_ERROR, TAG_VCC, ">>>> Request vc finalize : Fail to disconnect. err(%d)", ret); return ret; } diff --git a/client/vc_widget_tidl.c b/client/vc_widget_tidl.c index 2c7e705..9b6a80b 100644 --- a/client/vc_widget_tidl.c +++ b/client/vc_widget_tidl.c @@ -501,7 +501,19 @@ int vc_widget_tidl_request_finalize(int pid) } if (VC_ERROR_NONE != ret) { - SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget finalize : Fail to invoke message, error(%d)", ret); + SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget finalize : Fail to invoke finalize, error(%d)", ret); + pthread_mutex_unlock(&g_w_init_mutex); + return ret; + } + + ret = rpc_port_proxy_vc_widget_proxy_vc_widget_disconnect(g_proxy_tidl_info->rpc_h); + exception = get_last_result(); + if (RPC_PORT_ERROR_NONE != exception) { + ret = __convert_unhandled_error(exception); + } + + if (VC_ERROR_NONE != ret) { + SLOG(LOG_ERROR, TAG_VCW, "[TIDL ERROR] Request vc widget finalize : Fail to disconnect, error(%d)", ret); pthread_mutex_unlock(&g_w_init_mutex); return ret; }