From 278d2d3eab5e759809d4fee94ea8e9f388813cb2 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Thu, 20 Jun 2013 16:51:36 +0900 Subject: Fix various bugs. If the service_trigger_update fails, return its status. [issue#] N/A [problem] User wants to know how many instances are affected by update trigger request. [cause] Docomo requires this. [solution] Check the created instances and return NOT_EXISTS if there are no instances. [team] HomeTF [request] [horizontal_expansion] -------------------------------------------- Remove unnecessary storage space check code [issue#] P130607-6207 [problem] PD open/close is not related with storage space. [cause] Even if a user tries to open a PD, master checks disk space for openning it. [solution] PD open is not necessary to check the free disk space. So remove it. [team] HomeTF [request] [horizontal_expansion] -------------------------------------------- Apply GCC 4.8 patch [issue#] N/A [problem] GCC 4.8 complier complains about unused variables. [cause] Unused variables are declared. [solution] Remove it. [team] HomeTF [request] [horizontal_expansion] -------------------------------------------- Change-Id: Id861b50f65a00c3c9a25b1c01be7068e897f74e2 --- packaging/data-provider-master.spec | 2 +- src/server.c | 44 +++++++++++++++++++++++-------------- src/service_common.c | 3 --- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 4c9b77e..17922f9 100644 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -1,6 +1,6 @@ Name: data-provider-master Summary: Master service provider for liveboxes. -Version: 0.24.8 +Version: 0.24.9 Release: 1 Group: HomeTF/Livebox License: Flora License diff --git a/src/server.c b/src/server.c index e4a2b8e..c916263 100644 --- a/src/server.c +++ b/src/server.c @@ -4711,9 +4711,7 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe if (ret != LB_STATUS_SUCCESS) goto out; - if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) { - ret = LB_STATUS_ERROR_NO_SPACE; - } else if (instance_pd_owner(inst)) { + if (instance_pd_owner(inst)) { ret = LB_STATUS_ERROR_ALREADY; } else if (package_pd_type(instance_package(inst)) == PD_TYPE_BUFFER) { lazy_pd_destroyed_cb(inst); @@ -5978,13 +5976,6 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p goto out; } - if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) { - ErrPrint("Not enough space\n"); - ret = LB_STATUS_ERROR_NO_SPACE; - id = ""; - goto out; - } - ret = validate_request(pkgname, id, &inst, &pkg); id = ""; @@ -6124,13 +6115,6 @@ static struct packet *slave_resize_buffer(pid_t pid, int handle, const struct pa goto out; } - if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) { - ErrPrint("Not enough space\n"); - ret = LB_STATUS_ERROR_NO_SPACE; - id = ""; - goto out; - } - ret = validate_request(pkgname, id, &inst, &pkg); id = ""; if (ret != LB_STATUS_SUCCESS) @@ -6359,6 +6343,7 @@ out: static struct packet *service_update(pid_t pid, int handle, const struct packet *packet) { + Eina_List *inst_list; struct pkg_info *pkg; struct packet *result; const char *pkgname; @@ -6395,6 +6380,31 @@ static struct packet *service_update(pid_t pid, int handle, const struct packet goto out; } + inst_list = package_instance_list(pkg); + if (!eina_list_count(inst_list)) { + ret = LB_STATUS_ERROR_NOT_EXIST; + DbgFree(lb_pkgname); + goto out; + } + + if (id && strlen(id)) { + Eina_List *l; + struct inst_info *inst; + + ret = LB_STATUS_ERROR_NOT_EXIST; + EINA_LIST_FOREACH(inst_list, l, inst) { + if (!strcmp(instance_id(inst), id)) { + ret = LB_STATUS_SUCCESS; + break; + } + } + + if (ret == LB_STATUS_ERROR_NOT_EXIST) { + DbgFree(lb_pkgname); + goto out; + } + } + /*! * \TODO * Validate the update requstor. diff --git a/src/service_common.c b/src/service_common.c index d6d4007..2b57e56 100644 --- a/src/service_common.c +++ b/src/service_common.c @@ -813,14 +813,11 @@ HAPI struct service_context *tcb_svc_ctx(struct tcb *tcb) */ HAPI int service_common_unicast_packet(struct tcb *tcb, struct packet *packet) { - struct service_context *svc_ctx; if (!tcb || !packet) { DbgPrint("Invalid unicast: tcb[%p], packet[%p]\n", tcb, packet); return -EINVAL; } - svc_ctx = tcb->svc_ctx; - DbgPrint("Unicast packet\n"); return secure_socket_send(tcb->fd, (void *)packet_data(packet), packet_size(packet)); } -- cgit v1.2.3