Fix alias appid handler 88/254888/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 10 Mar 2021 08:50:37 +0000 (17:50 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 10 Mar 2021 08:50:37 +0000 (17:50 +0900)
To send the result properly, AMD should use aul_sock_send_raw_with_fd()
instead of _request_send_result().

Change-Id: I4c441d32914686b4b704ca2658d6790d786d3ad6
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/amd_app_property.c

index 22d12fd8ccf30d51a69ccc4b3829060674117b52..d5f5df70b3ca749a1d5f5f0ad39f97f39f0ae708 100644 (file)
@@ -1065,26 +1065,25 @@ static int __dispatch_app_get_appid_by_alias_appid(request_h req)
        bundle *b = _request_get_bundle(req);
        const char *alias_appid = bundle_get_val(b, AUL_K_ALIAS_APPID);
        app_property_h prop = _app_property_find(target_uid);
+       int fd = _request_remove_fd(req);
        const char *appid;
        bundle *res;
 
-       appid = _app_property_get_real_appid(prop, alias_appid);
-       if (!appid) {
-               _E("Failed to find real appid. alias_appid(%s)", alias_appid);
-               _request_send_result(req, -EINVAL);
-               return -1;
-       }
-
        res = bundle_create();
        if (!res) {
                _E("Out of memory");
-               _request_send_result(req, -EIO);
+               aul_sock_send_raw_with_fd(fd, -EIO, NULL, 0, AUL_SOCK_NOREPLY);
                return -1;
        }
 
-       bundle_add(res, AUL_K_APPID, appid);
-       aul_sock_send_bundle_with_fd(_request_remove_fd(req),
-                       _request_get_cmd(req), res, AUL_SOCK_NOREPLY);
+       appid = _app_property_get_real_appid(prop, alias_appid);
+       if (!appid)
+               _W("Failed to find real appid. alias_appid(%s)", alias_appid);
+       else
+               bundle_add(res, AUL_K_APPID, appid);
+
+       aul_sock_send_bundle_with_fd(fd, _request_get_cmd(req), res,
+                       AUL_SOCK_NOREPLY);
        bundle_free(res);
        _I("[APP_GET_APPID_BY_ALIAS_APPID] alias_appid(%s), appid(%s)",
                        alias_appid, appid);