diff options
author | Sung-jae Park <nicesj.park@samsung.com> | 2012-12-22 01:17:42 +0900 |
---|---|---|
committer | Sung-jae Park <nicesj.park@samsung.com> | 2012-12-22 01:17:42 +0900 |
commit | 8be2a90ea2e257a0cbdb45bab0e87a3cf2682c75 (patch) | |
tree | 8514c727c8c58c1d9c56ffa16e47a34a9e8c867a /src | |
parent | a587e5d0902e6484303d3545753a1597b613dc6e (diff) | |
download | data-provider-master-8be2a90ea2e257a0cbdb45bab0e87a3cf2682c75.tar.gz data-provider-master-8be2a90ea2e257a0cbdb45bab0e87a3cf2682c75.tar.bz2 data-provider-master-8be2a90ea2e257a0cbdb45bab0e87a3cf2682c75.zip |
Remove code of the deprecated feature
Change-Id: If5f503ed2c39c59df1ecd9f4a1ae6a35319352fb
Diffstat (limited to 'src')
-rw-r--r-- | src/conf.c | 25 | ||||
-rw-r--r-- | src/ctx_client.c | 359 | ||||
-rw-r--r-- | src/ctx_wrapper.c | 298 | ||||
-rw-r--r-- | src/instance.c | 12 | ||||
-rw-r--r-- | src/main.c | 7 | ||||
-rw-r--r-- | src/package.c | 22 | ||||
-rw-r--r-- | src/server.c | 38 | ||||
-rw-r--r-- | src/slave_life.c | 1 | ||||
-rw-r--r-- | src/util.c | 41 |
9 files changed, 51 insertions, 752 deletions
@@ -72,8 +72,6 @@ HAPI struct conf g_conf = { .ping_time = 240.0f, .slave_max_load = 30, - .vconf_sys_cluster = "file/private/org.tizen.data-provider-master/cluster", - .max_pended_ctx_events = 256, .use_sw_backend = 0, .provider_method = "pixmap", @@ -285,21 +283,6 @@ static void slave_max_loader(char *buffer) DbgPrint("Max load: %d\n", g_conf.slave_max_load); } -static void vconf_sys_cluster_handler(char *buffer) -{ - g_conf.vconf_sys_cluster = strdup(buffer); - if (!g_conf.vconf_sys_cluster) - ErrPrint("Heap %s\n", strerror(errno)); - DbgPrint("System cluster vconf key: %s\n", g_conf.vconf_sys_cluster); -} - -static void max_pended_ctx_event_handler(char *buffer) -{ - if (sscanf(buffer, "%d", &g_conf.max_pended_ctx_events) != 1) - ErrPrint("Failed to parse the max_pended_ctx_events\n"); - DbgPrint("Maximum pended event: %d\n", g_conf.max_pended_ctx_events); -} - HAPI int conf_loader(void) { FILE *fp; @@ -412,14 +395,6 @@ HAPI int conf_loader(void) .handler = slave_max_loader, }, { - .name = "vconf_sys_cluster", - .handler = vconf_sys_cluster_handler, - }, - { - .name = "max_pended_ctx_event", - .handler = max_pended_ctx_event_handler, - }, - { .name = "use_sw_backend", .handler = use_sw_backend_handler, }, diff --git a/src/ctx_client.c b/src/ctx_client.c deleted file mode 100644 index d1d27bd..0000000 --- a/src/ctx_client.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <stdio.h> -#include <unistd.h> - -#include <Ecore.h> -#include <gio/gio.h> - -#include <vconf.h> -#include <dlog.h> - -#include <packet.h> - -#include "debug.h" -#include "slave_life.h" -#include "slave_rpc.h" -#include "client_life.h" -#include "instance.h" -#include "client_rpc.h" -#include "package.h" -#include "group.h" -#include "conf.h" -#include "util.h" -#include "rpc_to_slave.h" -#include "setting.h" -#include "ctx_wrapper.h" -#include "xmonitor.h" - -static struct info { - Eina_List *event_list; -} s_info = { - .event_list = NULL, -}; - -struct pended_ctx_info { - char *cluster; - char *category; - char *pkgname; -}; - -static inline void processing_ctx_event(const char *cluster, const char *category, const char *pkgname) -{ - slave_rpc_request_update(pkgname, "", cluster, category); - if (util_free_space(IMAGE_PATH) > MINIMUM_SPACE) { - if (client_nr_of_subscriber(cluster, category) > 0) { - double timestamp; - struct inst_info *inst; - - timestamp = util_timestamp(); - inst = instance_create(NULL, timestamp, pkgname, DEFAULT_CONTENT, cluster, category, DEFAULT_PERIOD, 0, 0); - if (!inst) - ErrPrint("Failed to create an instance (%s / %s - %s)\n", cluster, category, pkgname); - } else { - DbgPrint("No subscribed clients. Ignore ctx event (%s / %s - %s)\n", cluster, category, pkgname); - } - } else { - ErrPrint("Not enough space\n"); - } - - DbgPrint("Context event is updated\n"); -} - -static inline int is_already_pended(const char *c_name, const char *s_name, const char *pkgname) -{ - Eina_List *l; - struct pended_ctx_info *info; - - EINA_LIST_FOREACH(s_info.event_list, l, info) { - if (strcmp(pkgname, info->pkgname)) - continue; - - if (strcmp(s_name, info->category)) - continue; - - if (strcmp(c_name, info->cluster)) - continue; - - return 1; - } - - return 0; -} - -static inline void push_pended_item(const char *c_name, const char *s_name, const char *pkgname) -{ - struct pended_ctx_info *pending_item; - - if (eina_list_count(s_info.event_list) >= MAX_PENDED_CTX_EVENTS) { - ErrPrint("Reach to count of a maximum pended ctx events\n"); - return; - } - - pending_item = malloc(sizeof(*pending_item)); - if (!pending_item) { - ErrPrint("Heap: %s\n", strerror(errno)); - return; - } - - pending_item->cluster = strdup(c_name); - if (!pending_item->cluster) { - ErrPrint("Heap: %s\n", strerror(errno)); - DbgFree(pending_item); - return; - } - - pending_item->category = strdup(s_name); - if (!pending_item->category) { - ErrPrint("Heap: %s\n", strerror(errno)); - DbgFree(pending_item->cluster); - DbgFree(pending_item); - return; - } - - pending_item->pkgname = strdup(pkgname); - if (!pending_item->pkgname) { - ErrPrint("Heap: %s\n", strerror(errno)); - DbgFree(pending_item->cluster); - DbgFree(pending_item->category); - DbgFree(pending_item); - return; - } - - s_info.event_list = eina_list_append(s_info.event_list, pending_item); - ErrPrint("Context event is pended (%s/%s - %s)\n", c_name, s_name, pkgname); -} - -static int ctx_changed_cb(struct context_item *item, void *user_data) -{ - const char *c_name; - const char *s_name; - const char *pkgname; - struct context_info *info; - struct category *category; - - info = group_context_info_from_item(item); - if (!info) { - ErrPrint("Context info is not valid (%p)\n", item); - return 0; - } - - category = group_category_from_context_info(info); - if (!category) { - ErrPrint("Category info is not valid: %p\n", info); - return 0; - } - - c_name = group_cluster_name_by_category(category); - s_name = group_category_name(category); - pkgname = group_pkgname_from_context_info(info); - - if (!c_name || !s_name || !pkgname) { - ErrPrint("Name is not valid (%s/%s/%s)\n", c_name, s_name, pkgname); - return 0; - } - - if (xmonitor_is_paused()) { - if (!is_already_pended(c_name, s_name, pkgname)) { - push_pended_item(c_name, s_name, pkgname); - } else { - DbgPrint("Already pended event : %s %s / %s\n", c_name, s_name, pkgname); - } - } else { - processing_ctx_event(c_name, s_name, pkgname); - } - - return 0; -} - -static inline void enable_event_handler(struct context_info *info) -{ - Eina_List *l; - Eina_List *item_list; - struct context_item *item; - - item_list = group_context_item_list(info); - EINA_LIST_FOREACH(item_list, l, item) { - void *handler; - - handler = group_context_item_data(item, "callback"); - if (handler) { - ErrPrint("Already registered ctx callback\n"); - continue; - } - - handler = ctx_wrapper_register_callback(item, ctx_changed_cb, NULL); - if (group_context_item_add_data(item, "callback", handler) < 0) - ctx_wrapper_unregister_callback(handler); - } -} - -static inline void register_callbacks(void) -{ - Eina_List *cluster_list; - Eina_List *l1; - struct cluster *cluster; - - Eina_List *category_list; - Eina_List *l2; - struct category *category; - - Eina_List *info_list; - Eina_List *l3; - struct context_info *info; - - cluster_list = group_cluster_list(); - EINA_LIST_FOREACH(cluster_list, l1, cluster) { - category_list = group_category_list(cluster); - EINA_LIST_FOREACH(category_list, l2, category) { - info_list = group_context_info_list(category); - EINA_LIST_FOREACH(info_list, l3, info) { - enable_event_handler(info); - } // info - } // category - } // cluster -} - -HAPI int ctx_enable_event_handler(struct context_info *info) -{ - int enabled; - - if (vconf_get_int(SYS_CLUSTER_KEY, &enabled) < 0) - enabled = 0; - - if (!enabled) { - DbgPrint("CTX in not enabled\n"); - return 0; - } - - enable_event_handler(info); - return 0; -} - -HAPI int ctx_disable_event_handler(struct context_info *info) -{ - Eina_List *l; - Eina_List *item_list; - struct context_item *item; - - item_list = group_context_item_list(info); - EINA_LIST_FOREACH(item_list, l, item) { - void *handler; - handler = group_context_item_del_data(item, "callback"); - if (handler) - ctx_wrapper_unregister_callback(handler); - } - - return 0; -} - -static inline void unregister_callbacks(void) -{ - Eina_List *cluster_list; - Eina_List *l1; - struct cluster *cluster; - - Eina_List *category_list; - Eina_List *l2; - struct category *category; - - Eina_List *info_list; - Eina_List *l3; - struct context_info *info; - - cluster_list = group_cluster_list(); - EINA_LIST_FOREACH(cluster_list, l1, cluster) { - category_list = group_category_list(cluster); - EINA_LIST_FOREACH(category_list, l2, category) { - info_list = group_context_info_list(category); - EINA_LIST_FOREACH(info_list, l3, info) { - ctx_disable_event_handler(info); - } // info - } // category - } // cluster -} - -static void ctx_vconf_cb(keynode_t *node, void *data) -{ - int enabled; - - if (!node) { - /*!< Enable this for default option */ - if (vconf_get_int(SYS_CLUSTER_KEY, &enabled) < 0) - enabled = 0; - } else { - enabled = vconf_keynode_get_int(node); - } - - if (!enabled) { - unregister_callbacks(); - ctx_wrapper_disable(); - return; - } - - ctx_wrapper_enable(); - register_callbacks(); -} - -static int xmonitor_pause_cb(void *data) -{ - DbgPrint("XMonitor Paused: do nothing\n"); - return 0; -} - -static int xmonitor_resume_cb(void *data) -{ - struct pended_ctx_info *item; - - EINA_LIST_FREE(s_info.event_list, item) { - DbgPrint("Pended ctx event for %s - %s / %s\n", item->cluster, item->category, item->pkgname); - processing_ctx_event(item->cluster, item->category, item->pkgname); - - DbgFree(item->cluster); - DbgFree(item->category); - DbgFree(item->pkgname); - DbgFree(item); - } - - return 0; -} - -HAPI int ctx_client_init(void) -{ - int ret; - - xmonitor_add_event_callback(XMONITOR_PAUSED, xmonitor_pause_cb, NULL); - xmonitor_add_event_callback(XMONITOR_RESUMED, xmonitor_resume_cb, NULL); - - ret = vconf_notify_key_changed(SYS_CLUSTER_KEY, ctx_vconf_cb, NULL); - if (ret < 0) - ErrPrint("Failed to register the system_cluster vconf\n"); - - ctx_vconf_cb(NULL, NULL); - return 0; -} - -HAPI int ctx_client_fini(void) -{ - vconf_ignore_key_changed(SYS_CLUSTER_KEY, ctx_vconf_cb); - - xmonitor_del_event_callback(XMONITOR_PAUSED, xmonitor_pause_cb, NULL); - xmonitor_del_event_callback(XMONITOR_RESUMED, xmonitor_resume_cb, NULL); - return 0; -} - -/* End of a file */ diff --git a/src/ctx_wrapper.c b/src/ctx_wrapper.c deleted file mode 100644 index 7b549db..0000000 --- a/src/ctx_wrapper.c +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <stdio.h> -#include <stdlib.h> /* malloc */ -#include <unistd.h> -#include <errno.h> -#include <string.h> /* strerror */ - -#include <dlog.h> - -#include <Eina.h> - -#include <context_manager.h> - -#include "util.h" -#include "debug.h" -#include "group.h" -#include "ctx_wrapper.h" -#include "conf.h" - -static struct { - int enabled; - Eina_List *cbdata_list; -} s_info = { - .enabled = 0, - .cbdata_list = NULL, -}; - -struct cbfunc { - int (*cb)(struct context_item *item, void *user_data); - void *user_data; - - struct cbdata *cbdata; -}; - -struct cbdata { - struct context_item *item; - int req_id; - context_option_s option; - - Eina_List *cbfunc_list; -}; - -static void update_context_cb(context_error_e error, int req_id, context_data_s *data, int data_size, void *user_data) -{ - Eina_List *l; - struct cbfunc *cbfunc; - struct cbdata *cbdata = (struct cbdata *)user_data; - - if (error != CONTEXT_ERROR_NONE) { - ErrPrint("REQ_ID[%d] Context update event has an error: %d\n", req_id, error); - return; - } - - DbgPrint("req_id: %d\n", req_id); - DbgPrint("data_size: %d\n", data_size); - - /*! - * \note - * Only for the safety. -_- - */ - if (cbdata->req_id != req_id) { - ErrPrint("Request ID is not matched\n"); - return; - } - - EINA_LIST_FOREACH(cbdata->cbfunc_list, l, cbfunc) { - if (cbfunc->cb(cbdata->item, cbfunc->user_data) != 0) { - ErrPrint("Callback is canceled\n"); - break; - } - } -} - -static inline struct cbdata *find_registered_callback(const char *ctx_item, Eina_List *option_list) -{ - Eina_List *l; - struct cbdata *cbdata; - register int i; - unsigned int mask; - Eina_List *il; - struct context_option *option; - const char *key; - const char *value; - - EINA_LIST_FOREACH(s_info.cbdata_list, l, cbdata) { - mask = 0x0; - - EINA_LIST_FOREACH(option_list, il, option) { - key = group_option_item_key(option); - value = group_option_item_value(option); - - for (i = 0; i < cbdata->option.array_size; i++) { - if (strcmp(cbdata->option.array[i].key, key)) - continue; - - if (strcmp(cbdata->option.array[i].value, value)) - continue; - - mask |= (0x01 << i); - } - } - - if (mask == ((0x01 << cbdata->option.array_size) - 1)) - return cbdata; - } - - return NULL; -} - -HAPI void ctx_wrapper_enable(void) -{ - int ret; - - if (s_info.enabled) - return; - - ret = context_manager_connect(); - if (ret == CONTEXT_ERROR_NONE) - s_info.enabled = 1; - - DbgPrint("Context engine is%senabled\n", s_info.enabled ? " " : " not "); -} - -HAPI void ctx_wrapper_disable(void) -{ - int ret; - - if (!s_info.enabled) - return; - - ret = context_manager_disconnect(); - if (ret == CONTEXT_ERROR_NONE) - s_info.enabled = 0; - - DbgPrint("Context engine is%sdisabled\n", s_info.enabled ? " not " : " "); -} - -static inline void register_ctx_callback(struct context_item *item, const char *ctx_item, struct cbfunc *cbfunc) -{ - Eina_List *l; - Eina_List *option_list; - struct context_option *option; - struct cbdata *cbdata; - const char *key; - const char *value; - int idx; - int ret; - - option_list = group_context_option_list(item); - if (!option_list) { - ErrPrint("Has no option list\n"); - return; - } - - cbdata = find_registered_callback(ctx_item, option_list); - if (cbdata) { - DbgPrint("Already registered\n"); - return; - } - - cbdata = malloc(sizeof(*cbdata)); - if (!cbdata) { - ErrPrint("Heap: %s\n", strerror(errno)); - return; - } - - cbdata->item = item; - cbdata->option.array_size = eina_list_count(option_list); - if (!cbdata->option.array_size) { - ErrPrint("Option is not exists. ignore this context event\n"); - DbgFree(cbdata); - return; - } - - cbdata->option.array = calloc(cbdata->option.array_size, sizeof(*cbdata->option.array)); - if (!cbdata->option.array) { - ErrPrint("Heap: %s\n", strerror(errno)); - DbgFree(cbdata); - return; - } - - idx = 0; - EINA_LIST_FOREACH(option_list, l, option) { - key = group_option_item_key(option); - value = group_option_item_value(option); - - if (!key || !value) { - ErrPrint("Key[%p], value[%p]\n", key, value); - continue; - } - - cbdata->option.array[idx].key = (char *)key; - cbdata->option.array[idx].value = (char *)value; - idx++; - } - - /*! - * WHY DO WE NEED TO KEEP THE req_id? - * Every callback function has their own callback_data. - * then...... we don't need to use req_id -_-;; - */ - ret = context_manager_add_context_updates_cb(ctx_item, &cbdata->option, update_context_cb, cbdata, &cbdata->req_id); - if (ret != CONTEXT_ERROR_NONE) { - DbgFree(cbdata->option.array); - DbgFree(cbdata); - return; - } - - s_info.cbdata_list = eina_list_append(s_info.cbdata_list, cbdata); - - cbdata->cbfunc_list = eina_list_prepend(cbdata->cbfunc_list, cbfunc); - cbfunc->cbdata = cbdata; -} - -HAPI void *ctx_wrapper_register_callback(struct context_item *item, int (*cb)(struct context_item *item, void *user_data), void *user_data) -{ - const char *ctx_item; - struct cbfunc *cbfunc; - - if (!item) { - ErrPrint("Item is not valid\n"); - return NULL; - } - - if (s_info.enabled) { - ErrPrint("CTX is not connected\n"); - return NULL; - } - - cbfunc = malloc(sizeof(*cbfunc)); - if (!cbfunc) { - ErrPrint("Heap: %s\n", strerror(errno)); - return NULL; - } - - cbfunc->cb = cb; - cbfunc->user_data = user_data; - - ctx_item = group_context_item(item); - if (ctx_item) - register_ctx_callback(item, ctx_item, cbfunc); - else - cbfunc->cbdata = NULL; - - return cbfunc; -} - -HAPI void *ctx_wrapper_unregister_callback(void *_cbfunc) -{ - struct cbdata *cbdata; - struct cbfunc *cbfunc = (struct cbfunc *)_cbfunc; - void *data; - - if (!s_info.enabled) { - ErrPrint("CTX is not connected\n"); - return NULL; - } - - cbdata = cbfunc->cbdata; - if (cbdata) { - cbdata->cbfunc_list = eina_list_remove(cbdata->cbfunc_list, cbfunc); - if (!eina_list_count(cbdata->cbfunc_list)) { - /*! - * \TODO - * Remove CALLBACK - * - * context_manager_remove_context_updates_for_item_cb - * context_manager_remove_context_updates_cb - */ - - s_info.cbdata_list = eina_list_remove(s_info.cbdata_list, cbdata); - DbgFree(cbdata->option.array); - DbgFree(cbdata); - DbgPrint("Callback removed\n"); - } - } - - data = cbfunc->user_data; - DbgFree(cbfunc); - return data; -} - -/* End of a file */ diff --git a/src/instance.c b/src/instance.c index 5b96bca..4d9086d 100644 --- a/src/instance.c +++ b/src/instance.c @@ -173,6 +173,9 @@ static inline void timer_freeze(struct inst_info *inst) struct timeval tv; ecore_timer_freeze(inst->update_timer); + if (ecore_timer_interval_get(inst->update_timer) <= 1.0f) + return; + gettimeofday(&tv, NULL); inst->sleep_at = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f; } @@ -836,10 +839,11 @@ static void reactivate_cb(struct slave_node *slave, const struct packet *packet, * Just leave it only for now. */ - if (lb_type == LB_TYPE_SCRIPT && inst->lb.canvas.script) + if (lb_type == LB_TYPE_SCRIPT && inst->lb.canvas.script) { script_handler_load(inst->lb.canvas.script, 0); - else if (lb_type == LB_TYPE_BUFFER && inst->lb.canvas.buffer) + } else if (lb_type == LB_TYPE_BUFFER && inst->lb.canvas.buffer) { buffer_handler_load(inst->lb.canvas.buffer); + } if (pd_type == PD_TYPE_SCRIPT && inst->pd.canvas.script && inst->pd.is_opened_for_reactivate) { double x, y; @@ -891,8 +895,10 @@ static void reactivate_cb(struct slave_node *slave, const struct packet *packet, * \note * After create an instance again, * Send resize request to the livebox. + * instance_resize(inst, inst->lb.width, inst->lb.height); + * + * renew request will resize the livebox while creating it again */ - instance_resize(inst, inst->lb.width, inst->lb.height); /*! * \note @@ -42,7 +42,6 @@ #include "group.h" #include "dead_monitor.h" #include "conf.h" -#include "ctx_client.h" #include "io.h" #include "xmonitor.h" #include "setting.h" @@ -100,9 +99,6 @@ static inline int app_create(void) ret = xmonitor_init(); DbgPrint("XMonitor init is done: %d\n", ret); - ret = ctx_client_init(); - DbgPrint("Context engine is initialized: %d\n", ret); - ret = buffer_handler_init(); DbgPrint("Buffer handler init is done: %d\n", ret); @@ -124,9 +120,6 @@ static inline int app_terminate(void) ret = setting_fini(); DbgPrint("Finalize setting : %d\n", ret); - ret = ctx_client_fini(); - DbgPrint("ctx_client_fini returns %d\n", ret); - xmonitor_fini(); instance_fini(); diff --git a/src/package.c b/src/package.c index 13178c4..cecc50e 100644 --- a/src/package.c +++ b/src/package.c @@ -40,7 +40,6 @@ #include "abi.h" #include "io.h" #include "pkgmgr.h" -#include "ctx_client.h" #include "xmonitor.h" int errno; @@ -271,12 +270,6 @@ static int slave_resumed_cb(struct slave_node *slave, void *data) static inline void destroy_package(struct pkg_info *info) { - struct context_info *ctx_info; - - EINA_LIST_FREE(info->ctx_list, ctx_info) { - ctx_disable_event_handler(ctx_info); - } - group_del_livebox(info->pkgname); package_clear_fault(info); @@ -461,8 +454,6 @@ static inline int load_conf(struct pkg_info *info) HAPI struct pkg_info *package_create(const char *pkgname) { struct pkg_info *pkginfo; - Eina_List *l; - struct context_info *ctx_info; pkginfo = calloc(1, sizeof(*pkginfo)); if (!pkginfo) { @@ -501,10 +492,6 @@ HAPI struct pkg_info *package_create(const char *pkgname) s_info.pkg_list = eina_list_append(s_info.pkg_list, pkginfo); - EINA_LIST_FOREACH(pkginfo->ctx_list, l, ctx_info) { - ctx_enable_event_handler(ctx_info); - } - return pkginfo; } @@ -1220,16 +1207,11 @@ static int io_uninstall_cb(const char *pkgname, int prime, void *data) static inline void reload_package_info(struct pkg_info *info) { - struct context_info *ctx_info; Eina_List *l; Eina_List *n; struct inst_info *inst; DbgPrint("Already exists, try to update it\n"); - EINA_LIST_FREE(info->ctx_list, ctx_info) { - ctx_disable_event_handler(ctx_info); - } - /*! * \note * Without "is_uninstalled", the package will be kept @@ -1246,10 +1228,6 @@ static inline void reload_package_info(struct pkg_info *info) * Nested DB I/O */ io_load_package_db(info); - - EINA_LIST_FOREACH(info->ctx_list, l, ctx_info) { - ctx_enable_event_handler(ctx_info); - } } static int io_install_cb(const char *pkgname, int prime, void *data) diff --git a/src/server.c b/src/server.c index 58c1ce4..600d255 100644 --- a/src/server.c +++ b/src/server.c @@ -2692,42 +2692,6 @@ out: return NULL; } -static inline char *get_file_kept_in_safe(const char *id) -{ - const char *path; - char *new_path; - int len; - int base_idx; - - path = util_uri_to_path(id); - if (!path) { - ErrPrint("Invalid URI(%s)\n", id); - return NULL; - } - - /*! - * TODO: Remove me - */ - if (OVERWRITE_CONTENT) - return strdup(path); - - len = strlen(path); - base_idx = len - 1; - - while (base_idx > 0 && path[base_idx] != '/') base_idx--; - base_idx += (path[base_idx] == '/'); - - new_path = malloc(len + 10); - if (!new_path) { - ErrPrint("Heap: %s\n", strerror(errno)); - return NULL; - } - - strncpy(new_path, path, base_idx); - snprintf(new_path + base_idx, len + 10 - base_idx, "reader/%s", path + base_idx); - return new_path; -} - static struct packet *slave_updated(pid_t pid, int handle, const struct packet *packet) /* slave_name, pkgname, filename, width, height, priority, ret */ { struct slave_node *slave; @@ -2776,7 +2740,7 @@ static struct packet *slave_updated(pid_t pid, int handle, const struct packet * case LB_TYPE_SCRIPT: script_handler_resize(instance_lb_script(inst), w, h); - filename = get_file_kept_in_safe(id); + filename = util_get_file_kept_in_safe(id); if (filename) { ret = script_handler_parse_desc(pkgname, id, filename, 0); diff --git a/src/slave_life.c b/src/slave_life.c index 7135b23..252f953 100644 --- a/src/slave_life.c +++ b/src/slave_life.c @@ -36,7 +36,6 @@ #include "slave_rpc.h" #include "client_life.h" #include "fault_manager.h" -#include "ctx_client.h" #include "debug.h" #include "conf.h" #include "setting.h" @@ -337,6 +337,11 @@ static inline void compensate_timer(Ecore_Timer *timer) double delay; double pending; + if (ecore_timer_interval_get(timer) <= 1.0f) { + DbgPrint("Doesn't need to sync the timer to start from ZERO sec\n"); + return; + } + if (gettimeofday(&tv, NULL) < 0) { ErrPrint("Error: %s\n", strerror(errno)); return; @@ -370,4 +375,40 @@ HAPI void util_timer_interval_set(void *timer, double interval) compensate_timer(timer); } +HAPI char *util_get_file_kept_in_safe(const char *id) +{ + const char *path; + char *new_path; + int len; + int base_idx; + + path = util_uri_to_path(id); + if (!path) { + ErrPrint("Invalid URI(%s)\n", id); + return NULL; + } + + /*! + * TODO: Remove me + */ + if (OVERWRITE_CONTENT) + return strdup(path); + + len = strlen(path); + base_idx = len - 1; + + while (base_idx > 0 && path[base_idx] != '/') base_idx--; + base_idx += (path[base_idx] == '/'); + + new_path = malloc(len + 10); + if (!new_path) { + ErrPrint("Heap: %s\n", strerror(errno)); + return NULL; + } + + strncpy(new_path, path, base_idx); + snprintf(new_path + base_idx, len + 10 - base_idx, "reader/%s", path + base_idx); + return new_path; +} + /* End of a file */ |