summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-05-23 13:15:35 +0900
committerSung-jae Park <nicesj.park@samsung.com>2013-05-23 13:15:35 +0900
commitcb87ae5ebd09c0e3fa93b212f4825182083aebdf (patch)
treea47ddc84888921060e3bdad17c16f817b0cf9be5
parent3f1f82cd5fae672047ecc091b1033dc21319ebf3 (diff)
downloaddata-provider-master-cb87ae5ebd09c0e3fa93b212f4825182083aebdf.tar.gz
data-provider-master-cb87ae5ebd09c0e3fa93b212f4825182083aebdf.tar.bz2
data-provider-master-cb87ae5ebd09c0e3fa93b212f4825182083aebdf.zip
Update Badge service routine & optimize log
Change-Id: I39501a3bea8662df92c46b4460bc98f48d520cbe
-rw-r--r--src/badge_service.c84
-rw-r--r--src/buffer_handler.c10
-rw-r--r--src/notification_service.c114
-rw-r--r--src/server.c354
-rw-r--r--src/service_common.c10
-rw-r--r--src/shortcut_service.c4
-rw-r--r--src/slave_life.c68
-rw-r--r--src/slave_rpc.c3
-rw-r--r--src/util.c2
-rw-r--r--src/utility_service.c2
10 files changed, 218 insertions, 433 deletions
diff --git a/src/badge_service.c b/src/badge_service.c
index 9b39e94..2001bc0 100644
--- a/src/badge_service.c
+++ b/src/badge_service.c
@@ -70,7 +70,7 @@ static inline char *get_string(char *string)
*/
static void _handler_insert_badge(struct tcb *tcb, struct packet *packet, void *data)
{
- int ret = 0;
+ int ret = 0, ret_p = 0;
struct packet *packet_reply = NULL;
struct packet *packet_service = NULL;
char *pkgname = NULL;
@@ -91,16 +91,26 @@ static void _handler_insert_badge(struct tcb *tcb, struct packet *packet, void *
packet_reply = packet_create_reply(packet, "i", ret);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret_p = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("Failed to send a reply packet:%d", ret_p);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("Failed to create a reply packet");
}
if (ret == BADGE_ERROR_NONE) {
packet_service = packet_create("insert_badge", "is", ret, pkgname);
if (packet_service != NULL) {
- service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret_p = service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("Failed to send a muticast packet:%d", ret_p);
+ }
packet_destroy(packet_service);
+ } else {
+ ErrPrint("Failed to create a multicast packet");
}
+ } else {
+ ErrPrint("Failed to insert a badge:%d", ret);
}
} else {
ErrPrint("Failed to get data from the packet");
@@ -109,7 +119,7 @@ static void _handler_insert_badge(struct tcb *tcb, struct packet *packet, void *
static void _handler_delete_badge(struct tcb *tcb, struct packet *packet, void *data)
{
- int ret = 0;
+ int ret = 0, ret_p = 0;
struct packet *packet_reply = NULL;
struct packet *packet_service = NULL;
char *pkgname = NULL;
@@ -128,16 +138,26 @@ static void _handler_delete_badge(struct tcb *tcb, struct packet *packet, void *
packet_reply = packet_create_reply(packet, "i", ret);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret_p = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("Failed to send a reply packet:%d", ret_p);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("Failed to create a reply packet");
}
if (ret == BADGE_ERROR_NONE) {
packet_service = packet_create("delete_badge", "is", ret, pkgname);
if (packet_service != NULL) {
- service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret_p = service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("Failed to send a muticast packet:%d", ret_p);
+ }
packet_destroy(packet_service);
+ } else {
+ ErrPrint("Failed to create a multicast packet");
}
+ } else {
+ ErrPrint("Failed to delete a badge:%d", ret);
}
} else {
ErrPrint("Failed to get data from the packet");
@@ -146,7 +166,7 @@ static void _handler_delete_badge(struct tcb *tcb, struct packet *packet, void *
static void _handler_set_badge_count(struct tcb *tcb, struct packet *packet, void *data)
{
- int ret = 0;
+ int ret = 0, ret_p = 0;
struct packet *packet_reply = NULL;
struct packet *packet_service = NULL;
char *pkgname = NULL;
@@ -166,16 +186,26 @@ static void _handler_set_badge_count(struct tcb *tcb, struct packet *packet, voi
packet_reply = packet_create_reply(packet, "i", ret);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret_p = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("Failed to send a reply packet:%d", ret_p);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("Failed to create a reply packet");
}
if (ret == BADGE_ERROR_NONE) {
packet_service = packet_create("set_badge_count", "isi", ret, pkgname, count);
if (packet_service != NULL) {
- service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret_p = service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("Failed to send a muticast packet:%d", ret_p);
+ }
packet_destroy(packet_service);
+ } else {
+ ErrPrint("Failed to create a multicast packet");
}
+ } else {
+ ErrPrint("Failed to set count of badge:%d", ret);
}
} else {
ErrPrint("Failed to get data from the packet");
@@ -184,7 +214,7 @@ static void _handler_set_badge_count(struct tcb *tcb, struct packet *packet, voi
static void _handler_set_display_option(struct tcb *tcb, struct packet *packet, void *data)
{
- int ret = 0;
+ int ret = 0, ret_p = 0;
struct packet *packet_reply = NULL;
struct packet *packet_service = NULL;
char *pkgname = NULL;
@@ -204,16 +234,26 @@ static void _handler_set_display_option(struct tcb *tcb, struct packet *packet,
packet_reply = packet_create_reply(packet, "i", ret);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret_p = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("Failed to send a reply packet:%d", ret_p);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("Failed to create a reply packet");
}
if (ret == BADGE_ERROR_NONE) {
packet_service = packet_create("set_disp_option", "isi", ret, pkgname, is_display);
if (packet_service != NULL) {
- service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret_p = service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("Failed to send a muticast packet:%d", ret_p);
+ }
packet_destroy(packet_service);
+ } else {
+ ErrPrint("Failed to create a multicast packet");
}
+ } else {
+ ErrPrint("Failed to set display option of badge:%d", ret);
}
} else {
ErrPrint("Failed to get data from the packet");
@@ -222,15 +262,22 @@ static void _handler_set_display_option(struct tcb *tcb, struct packet *packet,
static void _handler_service_register(struct tcb *tcb, struct packet *packet, void *data)
{
+ int ret = 0;
struct packet *packet_reply;
- int ret;
ret = tcb_client_type_set(tcb, TCB_CLIENT_TYPE_SERVICE);
+ if (ret < 0) {
+ ErrPrint("Failed to set the type of client:%d", ret);
+ }
packet_reply = packet_create_reply(packet, "i", ret);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("Failed to send a reply packet:%d", ret);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("Failed to create a reply packet");
}
}
@@ -268,9 +315,8 @@ static int service_thread_main(struct tcb *tcb, struct packet *packet, void *dat
},
};
- DbgPrint("TCB: %p, Packet: %p\n", tcb, packet);
if (!packet) {
- DbgPrint("TCB: %p is terminated\n", tcb);
+ DbgPrint("TCB: %p is terminated (NIL packet)\n", tcb);
return 0;
}
@@ -279,13 +325,11 @@ static int service_thread_main(struct tcb *tcb, struct packet *packet, void *dat
ErrPrint("Invalid command\n");
return -EINVAL;
}
- DbgPrint("Command: %s, Packet type[%d]\n", command, packet_type(packet));
+ DbgPrint("Command: [%s], Packet type[%d]\n", command, packet_type(packet));
switch (packet_type(packet)) {
case PACKET_REQ:
/* Need to send reply packet */
- DbgPrint("REQ: Command: [%s]\n", command);
-
for (i = 0; service_req_table[i].cmd; i++) {
if (strcmp(service_req_table[i].cmd, command))
continue;
@@ -339,7 +383,7 @@ HAPI int badge_service_fini(void)
return LB_STATUS_ERROR_INVALID;
service_common_destroy(s_info.svc_ctx);
- DbgPrint("Successfully Finalized\n");
+ DbgPrint("Successfully finalized\n");
return LB_STATUS_SUCCESS;
}
diff --git a/src/buffer_handler.c b/src/buffer_handler.c
index 7da0214..79d3c83 100644
--- a/src/buffer_handler.c
+++ b/src/buffer_handler.c
@@ -738,7 +738,7 @@ HAPI int buffer_handler_unload(struct buffer_info *info)
int ret;
if (!info) {
- DbgPrint("buffer handler is nil\n");
+ DbgPrint("buffer handler is NIL\n");
return LB_STATUS_ERROR_INVALID;
}
@@ -775,7 +775,7 @@ HAPI int buffer_handler_destroy(struct buffer_info *info)
struct buffer *buffer;
if (!info) {
- DbgPrint("Buffer is not created yet. info is nil\n");
+ DbgPrint("Buffer is not created yet. info is NIL\n");
return LB_STATUS_SUCCESS;
}
@@ -1071,7 +1071,7 @@ HAPI int buffer_handler_resize(struct buffer_info *info, int w, int h)
buffer_handler_update_size(info, w, h);
if (!info->is_loaded) {
- DbgPrint("Not yet loaded, just update the size [%dx%d]\n", w, h);
+ DbgPrint("Not yet loaded\n");
return LB_STATUS_SUCCESS;
}
@@ -1124,7 +1124,7 @@ static inline int sync_for_pixmap(struct buffer *buffer)
}
if (buffer->type != BUFFER_TYPE_PIXMAP) {
- DbgPrint("Invalid buffer\n");
+ ErrPrint("Invalid buffer\n");
return LB_STATUS_SUCCESS;
}
@@ -1281,8 +1281,6 @@ HAPI int buffer_handler_init(void)
return LB_STATUS_SUCCESS;
}
- DbgPrint("Open: %s (driver: %s)", deviceName, driverName);
-
if (USE_SW_BACKEND) {
DbgPrint("Fallback to the S/W Backend\n");
s_info.evt_base = 0;
diff --git a/src/notification_service.c b/src/notification_service.c
index 40f3b91..11fd207 100644
--- a/src/notification_service.c
+++ b/src/notification_service.c
@@ -102,7 +102,7 @@ static inline struct packet *create_packet_from_deleted_list(int op_num, int *li
*/
static void _handler_insert(struct tcb *tcb, struct packet *packet, void *data)
{
- int ret = 0;
+ int ret = 0, ret_p = 0;
int priv_id = 0;
struct packet *packet_reply = NULL;
struct packet *packet_service = NULL;
@@ -112,24 +112,32 @@ static void _handler_insert(struct tcb *tcb, struct packet *packet, void *data)
if (noti != NULL) {
if (notification_ipc_make_noti_from_packet(noti, packet) == NOTIFICATION_ERROR_NONE) {
ret = notification_noti_insert(noti);
- if (ret != NOTIFICATION_ERROR_NONE) {
- ErrPrint("failed to insert a notification\n");
- notification_free(noti);
- return ;
- }
-
notification_get_id(noti, NULL, &priv_id);
DbgPrint("priv_id: [%d]\n", priv_id);
packet_reply = packet_create_reply(packet, "ii", ret, priv_id);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret_p = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("failed to send reply packet: %d\n", ret_p);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("failed to create a reply packet\n");
+ }
+
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ ErrPrint("failed to insert a notification: %d\n", ret);
+ notification_free(noti);
+ return ;
}
packet_service = notification_ipc_make_packet_from_noti(noti, "add_noti", 2);
if (packet_service != NULL) {
- service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret_p = service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("failed to send a multicast packet: %d\n", ret_p);
+ }
packet_destroy(packet_service);
+ } else {
+ ErrPrint("failed to create a multicats packet\n");
}
} else {
ErrPrint("Failed to create the packet");
@@ -140,7 +148,7 @@ static void _handler_insert(struct tcb *tcb, struct packet *packet, void *data)
static void _handler_update(struct tcb *tcb, struct packet *packet, void *data)
{
- int ret = 0;
+ int ret = 0, ret_p = 0;
int priv_id = 0;
struct packet *packet_reply = NULL;
struct packet *packet_service = NULL;
@@ -150,23 +158,30 @@ static void _handler_update(struct tcb *tcb, struct packet *packet, void *data)
if (noti != NULL) {
if (notification_ipc_make_noti_from_packet(noti, packet) == NOTIFICATION_ERROR_NONE) {
ret = notification_noti_update(noti);
- if (ret != NOTIFICATION_ERROR_NONE) {
- ErrPrint("failed to update a notification\n");
- notification_free(noti);
- return ;
- }
notification_get_id(noti, NULL, &priv_id);
DbgPrint("priv_id: [%d]\n", priv_id);
packet_reply = packet_create_reply(packet, "ii", ret, priv_id);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret_p = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("failed to send reply packet:%d\n", ret_p);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("failed to create a reply packet\n");
+ }
+
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ ErrPrint("failed to update a notification:%d\n", ret);
+ notification_free(noti);
+ return ;
}
packet_service = notification_ipc_make_packet_from_noti(noti, "update_noti", 2);
if (packet_service != NULL) {
- service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret_p = service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("failed to send a multicast packet: %d\n", ret_p);
+ }
packet_destroy(packet_service);
}
} else {
@@ -178,21 +193,27 @@ static void _handler_update(struct tcb *tcb, struct packet *packet, void *data)
static void _handler_refresh(struct tcb *tcb, struct packet *packet, void *data)
{
- int ret = NOTIFICATION_ERROR_NONE;
+ int ret = 0;
struct packet *packet_reply = NULL;
packet_reply = packet_create_reply(packet, "i", ret);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("failed to send reply packet:%d\n", ret);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("failed to create a reply packet\n");
}
- service_common_multicast_packet(tcb, packet, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret = service_common_multicast_packet(tcb, packet, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("failed to send a multicast packet:%d\n", ret);
+ }
}
static void _handler_delete_single(struct tcb *tcb, struct packet *packet, void *data)
{
- int ret = 0;
+ int ret = 0, ret_p = 0;
int priv_id = 0;
struct packet *packet_reply = NULL;
struct packet *packet_service = NULL;
@@ -206,13 +227,24 @@ static void _handler_delete_single(struct tcb *tcb, struct packet *packet, void
DbgPrint("priv_id: [%d]\n", priv_id);
packet_reply = packet_create_reply(packet, "ii", ret, priv_id);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret_p = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("failed to send reply packet:%d\n", ret_p);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("failed to create a reply packet\n");
+ }
+
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ ErrPrint("failed to delete a notification:%d\n", ret);
+ return ;
}
packet_service = packet_create("del_noti_single", "ii", 1, priv_id);
if (packet_service != NULL) {
- service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret_p = service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("failed to send a multicast packet: %d\n", ret_p);
+ }
packet_destroy(packet_service);
}
} else {
@@ -222,7 +254,7 @@ static void _handler_delete_single(struct tcb *tcb, struct packet *packet, void
static void _handler_delete_multiple(struct tcb *tcb, struct packet *packet, void *data)
{
- int ret = 0;
+ int ret = 0, ret_p = 0;
struct packet *packet_reply = NULL;
struct packet *packet_service = NULL;
char *pkgname = NULL;
@@ -239,8 +271,20 @@ static void _handler_delete_multiple(struct tcb *tcb, struct packet *packet, voi
packet_reply = packet_create_reply(packet, "ii", ret, num_deleted);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret_p = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("failed to send reply packet:%d\n", ret_p);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("failed to create a reply packet\n");
+ }
+
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ ErrPrint("failed to delete notifications:%d\n", ret);
+ if (list_deleted != NULL) {
+ free(list_deleted);
+ }
+ return ;
}
if (num_deleted > 0) {
@@ -248,8 +292,12 @@ static void _handler_delete_multiple(struct tcb *tcb, struct packet *packet, voi
packet_service = create_packet_from_deleted_list(num_deleted, list_deleted, 0);
if (packet_service) {
- service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret_p = service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("failed to send a multicast packet: %d\n", ret_p);
+ }
packet_destroy(packet_service);
+ } else {
+ ErrPrint("failed to create a multicast packet\n");
}
} else {
int set = 0;
@@ -260,8 +308,12 @@ static void _handler_delete_multiple(struct tcb *tcb, struct packet *packet, voi
list_deleted, set * NOTIFICATION_DEL_PACKET_UNIT);
if (packet_service) {
- service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE);
+ if ((ret_p = service_common_multicast_packet(tcb, packet_service, TCB_CLIENT_TYPE_SERVICE)) < 0) {
+ ErrPrint("failed to send a multicast packet:%d\n", ret_p);
+ }
packet_destroy(packet_service);
+ } else {
+ ErrPrint("failed to create a multicast packet\n");
}
}
}
@@ -278,15 +330,19 @@ static void _handler_delete_multiple(struct tcb *tcb, struct packet *packet, voi
static void _handler_service_register(struct tcb *tcb, struct packet *packet, void *data)
{
+ int ret = 0;
struct packet *packet_reply;
- int ret;
ret = tcb_client_type_set(tcb, TCB_CLIENT_TYPE_SERVICE);
packet_reply = packet_create_reply(packet, "i", ret);
if (packet_reply) {
- service_common_unicast_packet(tcb, packet_reply);
+ if ((ret = service_common_unicast_packet(tcb, packet_reply)) < 0) {
+ ErrPrint("failed to send reply packet:%d\n", ret);
+ }
packet_destroy(packet_reply);
+ } else {
+ ErrPrint("failed to create a reply packet\n");
}
}
diff --git a/src/server.c b/src/server.c
index d7ab848..811db78 100644
--- a/src/server.c
+++ b/src/server.c
@@ -191,7 +191,6 @@ static int event_pd_route_cb(enum event_state state, struct event_data *event_in
if (!slave)
return LB_STATUS_ERROR_INVALID;
- DbgPrint("Event: %dx%d\n", event_info->x, event_info->y);
switch (state) {
case EVENT_STATE_ACTIVATE:
cmdstr = "pd_mouse_down";
@@ -233,7 +232,6 @@ static int event_pd_consume_cb(enum event_state state, struct event_data *event_
if (!e)
return LB_STATUS_ERROR_FAULT;
- DbgPrint("Event: %dx%d\n", event_info->x, event_info->y);
timestamp = util_timestamp();
switch (state) {
@@ -343,7 +341,7 @@ static struct packet *client_clicked(pid_t pid, int handle, const struct packet
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s] event[%s] timestamp[%lf] x[%lf] y[%lf]\n", pid, pkgname, id, event, timestamp, x, y);
+ DbgPrint("pid[%d] pkgname[%s]\n", pid, pkgname);
/*!
* \NOTE:
@@ -440,7 +438,7 @@ static struct packet *client_text_signal(pid_t pid, int handle, const struct pac
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s] emission[%s] source[%s] sx[%lf] sy[%lf] ex[%lf] ey[%lf]\n", pid, pkgname, id, emission, source, sx, sy, ex, ey);
+ DbgPrint("pid[%d] pkgname[%s] emission[%s] source[%s]\n", pid, pkgname, emission, source);
/*!
* \NOTE:
@@ -507,7 +505,7 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s]\n", pid, pkgname, id);
+ DbgPrint("pid[%d] pkgname[%s]\n", pid, pkgname);
/*!
* \NOTE:
@@ -590,8 +588,7 @@ static struct packet *client_resize(pid_t pid, int handle, const struct packet *
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s] w[%d] h[%d]\n", pid, pkgname, id, w, h);
- DbgPrint("RESIZE: INSTANCE[%s] Client request resize to %dx%d\n", id, w, h);
+ DbgPrint("RESIZE: Client request resize to %dx%d (pid: %d, pkgname: %s)\n", w, h, pid, pkgname);
/*!
* \NOTE:
@@ -715,7 +712,7 @@ static struct packet *client_change_visibility(pid_t pid, int handle, const stru
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s] state[%d]\n", pid, pkgname, id, state);
+ DbgPrint("pid[%d] pkgname[%s] state[%d]\n", pid, pkgname, state);
/*!
* \NOTE:
@@ -762,7 +759,7 @@ static struct packet *client_set_period(pid_t pid, int handle, const struct pack
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s] period[%lf]\n", pid, pkgname, id, period);
+ DbgPrint("pid[%d] pkgname[%s] period[%lf]\n", pid, pkgname, period);
/*!
* \NOTE:
@@ -813,7 +810,7 @@ static struct packet *client_change_group(pid_t pid, int handle, const struct pa
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s] cluster[%s] category[%s]\n", pid, pkgname, id, cluster, category);
+ DbgPrint("pid[%d] pkgname[%s] cluster[%s] category[%s]\n", pid, pkgname, cluster, category);
/*!
* \NOTE:
@@ -895,7 +892,6 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -911,15 +907,6 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -1007,7 +994,6 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -1023,15 +1009,6 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -1089,8 +1066,6 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
goto out;
}
- DbgPrint("(%dx%d)\n", x, y);
-
/*!
* \NOTE:
* Trust the package name which are sent by the client.
@@ -1121,7 +1096,6 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -1137,15 +1111,6 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_down", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -1203,7 +1168,6 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
goto out;
}
- DbgPrint("(%dx%d)\n", x, y);
/*!
* \NOTE:
* Trust the package name which are sent by the client.
@@ -1234,7 +1198,6 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -1250,15 +1213,6 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_up", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -1316,7 +1270,6 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
goto out;
}
- DbgPrint("(%dx%d)\n", x, y);
/*!
* \NOTE:
* Trust the package name which are sent by the client.
@@ -1347,7 +1300,6 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -1363,15 +1315,6 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
goto out;
}
- /*!
- * Reuse the packet.
- packet = packet_create_noack("pd_mouse_move", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -1459,7 +1402,6 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -1475,14 +1417,6 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_move", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -1851,7 +1785,6 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -1867,14 +1800,6 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -1962,7 +1887,6 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -1978,15 +1902,6 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -2074,7 +1989,6 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -2090,15 +2004,6 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_down", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -2186,7 +2091,6 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -2202,15 +2106,6 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_up", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -2299,7 +2194,6 @@ static struct packet *client_pd_access_action_up(pid_t pid, int handle, const st
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -2315,15 +2209,6 @@ static struct packet *client_pd_access_action_up(pid_t pid, int handle, const st
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -2433,7 +2318,6 @@ static struct packet *client_pd_access_action_down(pid_t pid, int handle, const
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -2449,15 +2333,6 @@ static struct packet *client_pd_access_action_down(pid_t pid, int handle, const
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -2567,7 +2442,6 @@ static struct packet *client_pd_access_scroll_down(pid_t pid, int handle, const
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -2583,15 +2457,6 @@ static struct packet *client_pd_access_scroll_down(pid_t pid, int handle, const
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -2701,7 +2566,6 @@ static struct packet *client_pd_access_scroll_move(pid_t pid, int handle, const
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -2717,15 +2581,6 @@ static struct packet *client_pd_access_scroll_move(pid_t pid, int handle, const
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -2835,7 +2690,6 @@ static struct packet *client_pd_access_scroll_up(pid_t pid, int handle, const st
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -2851,15 +2705,6 @@ static struct packet *client_pd_access_scroll_up(pid_t pid, int handle, const st
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -2959,7 +2804,6 @@ static struct packet *client_pd_access_unhighlight(pid_t pid, int handle, const
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -2975,15 +2819,6 @@ static struct packet *client_pd_access_unhighlight(pid_t pid, int handle, const
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -3092,7 +2927,6 @@ static struct packet *client_pd_access_hl(pid_t pid, int handle, const struct pa
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -3108,15 +2942,6 @@ static struct packet *client_pd_access_hl(pid_t pid, int handle, const struct pa
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -3226,7 +3051,6 @@ static struct packet *client_pd_access_hl_prev(pid_t pid, int handle, const stru
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -3242,15 +3066,6 @@ static struct packet *client_pd_access_hl_prev(pid_t pid, int handle, const stru
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -3361,7 +3176,6 @@ static struct packet *client_pd_access_hl_next(pid_t pid, int handle, const stru
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -3377,14 +3191,6 @@ static struct packet *client_pd_access_hl_next(pid_t pid, int handle, const stru
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
DbgPrint("Buffer type PD\n");
packet_ref((struct packet *)packet);
@@ -3503,7 +3309,6 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -3519,15 +3324,6 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -3636,7 +3432,6 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -3652,15 +3447,6 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -3806,7 +3592,6 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe
} else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- // struct packet *packet;
buffer = instance_pd_buffer(inst);
if (!buffer) {
@@ -3822,15 +3607,6 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe
goto out;
}
- /*
- packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) {
@@ -3921,7 +3697,6 @@ static struct packet *client_lb_access_hl(pid_t pid, int handle, const struct pa
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -3937,15 +3712,6 @@ static struct packet *client_lb_access_hl(pid_t pid, int handle, const struct pa
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -4055,7 +3821,6 @@ static struct packet *client_lb_access_hl_prev(pid_t pid, int handle, const stru
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -4071,15 +3836,6 @@ static struct packet *client_lb_access_hl_prev(pid_t pid, int handle, const stru
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -4189,7 +3945,6 @@ static struct packet *client_lb_access_hl_next(pid_t pid, int handle, const stru
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -4205,15 +3960,6 @@ static struct packet *client_lb_access_hl_next(pid_t pid, int handle, const stru
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -4563,7 +4309,6 @@ static struct packet *client_lb_access_unhighlight(pid_t pid, int handle, const
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -4579,15 +4324,6 @@ static struct packet *client_lb_access_unhighlight(pid_t pid, int handle, const
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -5057,7 +4793,6 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -5073,15 +4808,6 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -5192,7 +4918,6 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -5208,15 +4933,6 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -5307,7 +5023,6 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe
} else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
struct buffer_info *buffer;
struct slave_node *slave;
- //struct packet *packet;
buffer = instance_lb_buffer(inst);
if (!buffer) {
@@ -5323,15 +5038,6 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe
goto out;
}
- /*
- packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
- if (!packet) {
- ErrPrint("Failed to create a packet[%s]\n", pkgname);
- ret = LB_STATUS_ERROR_FAULT;
- goto out;
- }
- */
-
packet_ref((struct packet *)packet);
ret = slave_rpc_request_only(slave, pkgname, (struct packet *)packet, 0);
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
@@ -5408,7 +5114,7 @@ static struct packet *client_lb_acquire_pixmap(pid_t pid, int handle, const stru
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s]\n", pid, pkgname, id);
+ DbgPrint("pid[%d] pkgname[%s]\n", pid, pkgname);
buffer = instance_lb_buffer(inst);
if (!buffer) {
ErrPrint("Unable to get LB buffer: %s\n", id);
@@ -5458,7 +5164,7 @@ static struct packet *client_lb_release_pixmap(pid_t pid, int handle, const stru
ErrPrint("Parameter is not matched\n");
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s] Pixmap[0x%X]\n", pid, pkgname, id, pixmap);
+ DbgPrint("pid[%d] pkgname[%s] Pixmap[0x%X]\n", pid, pkgname, pixmap);
/*!
* \NOTE:
@@ -5520,7 +5226,7 @@ static struct packet *client_pd_acquire_pixmap(pid_t pid, int handle, const stru
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s]\n", pid, pkgname, id);
+ DbgPrint("pid[%d] pkgname[%s]\n", pid, pkgname);
buffer = instance_pd_buffer(inst);
if (!buffer) {
ErrPrint("Unable to get PD buffer (%s)\n", id);
@@ -5567,7 +5273,7 @@ static struct packet *client_pd_release_pixmap(pid_t pid, int handle, const stru
ErrPrint("Parameter is not matched\n");
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s]\n", pid, pkgname, id);
+ DbgPrint("pid[%d] pkgname[%s]\n", pid, pkgname);
/*!
* \NOTE:
@@ -5620,7 +5326,7 @@ static struct packet *client_pinup_changed(pid_t pid, int handle, const struct p
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s] pinup[%d]\n", pid, pkgname, id, pinup);
+ DbgPrint("pid[%d] pkgname[%s] pinup[%d]\n", pid, pkgname, pinup);
/*!
* \NOTE:
@@ -5692,7 +5398,7 @@ static struct packet *client_pd_move(pid_t pid, int handle, const struct packet
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s] %lfx%lf\n", pid, pkgname, id, x, y);
+ DbgPrint("pid[%d] pkgname[%s]\n", pid, pkgname);
inst = package_find_instance_by_id(pkgname, id);
if (!inst)
@@ -5720,7 +5426,7 @@ static struct packet *client_pd_move(pid_t pid, int handle, const struct packet
ret = LB_STATUS_ERROR_INVALID;
}
out:
- DbgPrint("Update PD position: %lfx%lf (%d)\n", x, y, ret);
+ DbgPrint("Update PD position: %d\n", ret);
return NULL;
}
@@ -5749,7 +5455,7 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s]\n", pid, pkgname, id);
+ DbgPrint("pid[%d] pkgname[%s]\n", pid, pkgname);
/*!
* \NOTE:
@@ -5869,7 +5575,7 @@ static struct packet *client_destroy_pd(pid_t pid, int handle, const struct pack
goto out;
}
- DbgPrint("pid[%d] pkgname[%s] id[%s]\n", pid, pkgname, id);
+ DbgPrint("pid[%d] pkgname[%s]\n", pid, pkgname);
/*!
* \NOTE:
@@ -6382,7 +6088,6 @@ static struct packet *slave_faulted(pid_t pid, int handle, const struct packet *
ErrPrint("Instance(%s) is already destroyed\n", id);
} else {
ret = instance_destroy(inst);
- DbgPrint("Destroy instance(%s) %d\n", id, ret);
}
out:
@@ -6810,7 +6515,6 @@ static struct packet *slave_desc_updated(pid_t pid, int handle, const struct pac
} else {
switch (package_pd_type(instance_package(inst))) {
case PD_TYPE_SCRIPT:
- DbgPrint("Script (%s)\n", id);
if (script_handler_is_loaded(instance_pd_script(inst))) {
(void)script_handler_parse_desc(pkgname, id,
descfile, 1);
@@ -6822,8 +6526,7 @@ static struct packet *slave_desc_updated(pid_t pid, int handle, const struct pac
instance_pd_updated(pkgname, id, descfile);
break;
default:
- DbgPrint("Ignore updated DESC(%s - %s - %s)\n",
- pkgname, id, descfile);
+ DbgPrint("Ignore updated DESC(%s)\n", pkgname);
break;
}
}
@@ -6857,7 +6560,6 @@ static struct packet *slave_deleted(pid_t pid, int handle, const struct packet *
} else if (package_is_fault(instance_package(inst))) {
} else {
ret = instance_destroyed(inst);
- DbgPrint("Destroy instance %d\n", ret);
}
out:
@@ -6907,7 +6609,7 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
/* TODO: */
inst = package_find_instance_by_id(pkgname, id);
if (!inst) {
- DbgPrint("Package[%s] Id[%s] is not found\n", pkgname, id);
+ DbgPrint("Package[%s] instance is not found\n", pkgname);
ret = LB_STATUS_ERROR_INVALID;
id = "";
goto out;
@@ -6936,24 +6638,19 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
}
ret = buffer_handler_resize(info, w, h);
- DbgPrint("Buffer resize returns %d\n", ret);
-
ret = buffer_handler_load(info);
if (ret == 0) {
instance_set_lb_size(inst, w, h);
instance_set_lb_info(inst, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
id = buffer_handler_id(info);
- DbgPrint("Buffer handler ID: %s\n", id);
} else {
- DbgPrint("Failed to load a buffer(%d)\n", ret);
+ ErrPrint("Failed to load a buffer(%d)\n", ret);
}
}
} else if (target == TYPE_PD) {
if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
struct buffer_info *info;
- DbgPrint("Slave acquire buffer for PD\n");
-
info = instance_pd_buffer(inst);
if (!info) {
if (!instance_create_pd_buffer(inst)) {
@@ -6971,15 +6668,12 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
}
ret = buffer_handler_resize(info, w, h);
- DbgPrint("Buffer resize returns %d\n", ret);
-
ret = buffer_handler_load(info);
if (ret == 0) {
instance_set_pd_size(inst, w, h);
id = buffer_handler_id(info);
- DbgPrint("Buffer handler ID: %s\n", id);
} else {
- DbgPrint("Failed to load a buffer (%d)\n", ret);
+ ErrPrint("Failed to load a buffer (%d)\n", ret);
}
/*!
@@ -7035,7 +6729,7 @@ static struct packet *slave_resize_buffer(pid_t pid, int handle, const struct pa
inst = package_find_instance_by_id(pkgname, id);
if (!inst) {
- DbgPrint("Instance is not found[%s] [%s]\n", pkgname, id);
+ DbgPrint("Instance is not found[%s]\n", pkgname);
ret = LB_STATUS_ERROR_NOT_EXIST;
id = "";
goto out;
@@ -7143,8 +6837,6 @@ static struct packet *slave_release_buffer(pid_t pid, int handle, const struct p
} else if (type == TYPE_PD) {
struct buffer_info *info;
- DbgPrint("Slave release buffer for PD\n");
-
info = instance_pd_buffer(inst);
ret = buffer_handler_unload(info);
@@ -7195,7 +6887,7 @@ static struct packet *service_change_period(pid_t pid, int handle, const struct
EINA_LIST_FOREACH(inst_list, l, inst) {
ret = instance_set_period(inst, period);
if (ret < 0)
- DbgPrint("Failed to change the period of %s to (%lf)\n", instance_id(inst), period);
+ ErrPrint("Failed to change the period of %s to (%lf)\n", pkgname, period);
}
}
} else {
@@ -7208,7 +6900,7 @@ static struct packet *service_change_period(pid_t pid, int handle, const struct
ret = instance_set_period(inst, period);
}
- DbgPrint("Change the update period: %s(%s), %lf : %d\n", pkgname, id, period, ret);
+ DbgPrint("Change the update period: %s, %lf : %d\n", pkgname, period, ret);
out:
result = packet_create_reply(packet, "i", ret);
if (!result)
diff --git a/src/service_common.c b/src/service_common.c
index 5b2a01a..91c046d 100644
--- a/src/service_common.c
+++ b/src/service_common.c
@@ -551,8 +551,6 @@ static void *server_main(void *data)
break;
}
- DbgPrint("Event CH: %c\n", evt_ch);
-
CRITICAL_SECTION_BEGIN(&svc_ctx->packet_list_lock);
packet_info = eina_list_nth(svc_ctx->packet_list, 0);
svc_ctx->packet_list = eina_list_remove(svc_ctx->packet_list, packet_info);
@@ -772,8 +770,10 @@ 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)
+ if (!tcb || !packet) {
+ DbgPrint("Invalid unicast: tcb[%p], packet[%p]\n", tcb, packet);
return -EINVAL;
+ }
svc_ctx = tcb->svc_ctx;
@@ -792,8 +792,10 @@ HAPI int service_common_multicast_packet(struct tcb *tcb, struct packet *packet,
struct service_context *svc_ctx;
int ret;
- if (!tcb || !packet)
+ if (!tcb || !packet) {
+ DbgPrint("Invalid multicast: tcb[%p], packet[%p]\n", tcb, packet);
return -EINVAL;
+ }
svc_ctx = tcb->svc_ctx;
diff --git a/src/shortcut_service.c b/src/shortcut_service.c
index 81b9005..973a2ba 100644
--- a/src/shortcut_service.c
+++ b/src/shortcut_service.c
@@ -94,9 +94,8 @@ static int service_thread_main(struct tcb *tcb, struct packet *packet, void *dat
{
const char *command;
- DbgPrint("TCB: %p, Packet: %p\n", tcb, packet);
if (!packet) {
- DbgPrint("TCB: %p is terminated\n", tcb);
+ DbgPrint("TCB: %p is terminated (NIL packet)\n", tcb);
return 0;
}
@@ -105,7 +104,6 @@ static int service_thread_main(struct tcb *tcb, struct packet *packet, void *dat
ErrPrint("Invalid command\n");
return -EINVAL;
}
- DbgPrint("Command: %s, Packet type[%d]\n", command, packet_type(packet));
switch (packet_type(packet)) {
case PACKET_REQ:
diff --git a/src/slave_life.c b/src/slave_life.c
index 5d7dbf3..6d51ccb 100644
--- a/src/slave_life.c
+++ b/src/slave_life.c
@@ -174,7 +174,6 @@ static inline struct slave_node *create_slave_node(const char *name, int is_secu
xmonitor_add_event_callback(XMONITOR_RESUMED, xmonitor_resume_cb, slave);
s_info.slave_list = eina_list_append(s_info.slave_list, slave);
- DbgPrint("slave data is created %p\n", slave);
return slave;
}
@@ -201,13 +200,11 @@ static inline void destroy_slave_node(struct slave_node *slave)
struct event *event;
struct priv_data *priv;
- if (slave->pid != (pid_t)-1) {
+ if (slave_pid(slave) != (pid_t)-1) {
ErrPrint("Slave is not deactivated\n");
return;
}
- DbgPrint("Slave data is destroyed %p\n", slave);
-
xmonitor_del_event_callback(XMONITOR_PAUSED, xmonitor_pause_cb, slave);
xmonitor_del_event_callback(XMONITOR_RESUMED, xmonitor_resume_cb, slave);
@@ -385,16 +382,16 @@ static Eina_Bool activate_timer_cb(void *data)
slave_set_reactivate_instances(slave, 0);
slave->activate_timer = NULL;
- if (slave->pid > 0) {
+ if (slave_pid(slave) > 0) {
int ret;
- DbgPrint("Try to terminate PID: %d\n", slave->pid);
- ret = aul_terminate_pid(slave->pid);
+ DbgPrint("Try to terminate PID: %d\n", slave_pid(slave));
+ ret = aul_terminate_pid(slave_pid(slave));
if (ret < 0)
- ErrPrint("Terminate failed, pid %d\n", slave->pid);
+ ErrPrint("Terminate failed, pid %d (reason: %d)\n", slave_pid(slave), ret);
}
+ ErrPrint("Slave is not activated in %lf sec (slave: %s)\n", SLAVE_ACTIVATE_TIME, slave_name(slave));
slave = slave_deactivated(slave);
- ErrPrint("Slave is not activated in %lf sec (slave: %p)\n", SLAVE_ACTIVATE_TIME, slave);
return ECORE_CALLBACK_CANCEL;
}
@@ -410,11 +407,11 @@ HAPI int slave_activate(struct slave_node *slave)
* So we can use this simple code for checking the slave's last state.
* about it is alive? or not.
*/
- if (slave->pid != (pid_t)-1)
+ if (slave_pid(slave) != (pid_t)-1)
return LB_STATUS_ERROR_ALREADY;
if (DEBUG_MODE) {
- DbgPrint("Debug Mode enabled. name[%s] secured[%d] abi[%s]\n", slave->name, slave->secured, slave->abi);
+ DbgPrint("Debug Mode enabled. name[%s] secured[%d] abi[%s]\n", slave_name(slave), slave->secured, slave->abi);
} else {
bundle *param;
param = bundle_create();
@@ -423,21 +420,20 @@ HAPI int slave_activate(struct slave_node *slave)
return LB_STATUS_ERROR_FAULT;
}
- bundle_add(param, BUNDLE_SLAVE_NAME, slave->name);
+ bundle_add(param, BUNDLE_SLAVE_NAME, slave_name(slave));
bundle_add(param, BUNDLE_SLAVE_SECURED, slave->secured ? "true" : "false");
bundle_add(param, BUNDLE_SLAVE_ABI, slave->abi);
- DbgPrint("Launch the slave package: %s\n", slave->pkgname);
- slave->pid = (pid_t)aul_launch_app(slave->pkgname, param);
+ slave->pid = (pid_t)aul_launch_app(slave_pkgname(slave), param);
bundle_free(param);
if (slave->pid < 0) {
- ErrPrint("Failed to launch a new slave %s (%d)\n", slave->name, slave->pid);
+ ErrPrint("Failed to launch a new slave %s (%d)\n", slave_name(slave), slave->pid);
slave->pid = (pid_t)-1;
return LB_STATUS_ERROR_FAULT;
}
- DbgPrint("Slave launched %d for %s\n", slave->pid, slave->name);
+ DbgPrint("Slave %s is launched with %d as %s\n", slave_pkgname(slave), slave->pid, slave_name(slave));
slave->activate_timer = ecore_timer_add(SLAVE_ACTIVATE_TIME, activate_timer_cb, slave);
if (!slave->activate_timer)
@@ -450,7 +446,7 @@ HAPI int slave_activate(struct slave_node *slave)
* Increase the refcnt of a slave,
* To prevent from making an orphan(slave).
*/
- slave_ref(slave);
+ (void)slave_ref(slave);
return LB_STATUS_SUCCESS;
}
@@ -498,7 +494,7 @@ HAPI int slave_activated(struct slave_node *slave)
slave_pause(slave);
if (slave->secured == 1) {
- DbgPrint("Slave deactivation timer is added (%s - %lf)\n", slave->name, SLAVE_TTL);
+ DbgPrint("Slave deactivation timer is added (%s - %lf)\n", slave_name(slave), SLAVE_TTL);
slave->ttl_timer = ecore_timer_add(SLAVE_TTL, slave_ttl_cb, slave);
if (!slave->ttl_timer)
ErrPrint("Failed to create a TTL timer\n");
@@ -563,18 +559,17 @@ HAPI struct slave_node *slave_deactivate(struct slave_node *slave)
return slave;
}
- DbgPrint("Deactivate a slave: %d\n", slave->pid);
/*!
* \todo
* check the return value of the aul_terminate_pid
*/
slave->state = SLAVE_REQUEST_TO_TERMINATE;
- DbgPrint("Terminate PID: %d\n", slave->pid);
- if (slave->pid > 0) {
+ if (slave_pid(slave) > 0) {
+ DbgPrint("Terminate slave: %d (%s)\n", slave_pid(slave), slave_name(slave));
ret = aul_terminate_pid(slave->pid);
if (ret < 0) {
- ErrPrint("Terminate failed. pid %d (%d)\n", slave->pid, ret);
+ ErrPrint("Terminate slave(%s) failed. pid %d (%d)\n", slave_name(slave), slave_pid(slave), ret);
slave = slave_deactivated(slave);
}
}
@@ -645,11 +640,11 @@ HAPI struct slave_node *slave_deactivated_by_fault(struct slave_node *slave)
(void)fault_check_pkgs(slave);
- if (slave->pid > 0) {
- DbgPrint("Try to terminate PID: %d\n", slave->pid);
- ret = aul_terminate_pid(slave->pid);
+ if (slave_pid(slave) > 0) {
+ DbgPrint("Try to terminate PID: %d\n", slave_pid(slave));
+ ret = aul_terminate_pid(slave_pid(slave));
if (ret < 0) {
- ErrPrint("Terminate failed, pid %d\n", slave->pid);
+ ErrPrint("Terminate failed, pid %d\n", slave_pid(slave));
}
}
@@ -894,7 +889,7 @@ HAPI struct slave_node *slave_find_by_pid(pid_t pid)
struct slave_node *slave;
EINA_LIST_FOREACH(s_info.slave_list, l, slave) {
- if (slave->pid == pid)
+ if (slave_pid(slave) == pid)
return slave;
}
@@ -907,7 +902,7 @@ HAPI struct slave_node *slave_find_by_name(const char *name)
struct slave_node *slave;
EINA_LIST_FOREACH(s_info.slave_list, l, slave) {
- if (!strcmp(slave->name, name))
+ if (!strcmp(slave_name(slave), name))
return slave;
}
@@ -940,11 +935,12 @@ HAPI struct slave_node *slave_find_available(const char *abi, int secured, int n
continue;
if (slave->secured) {
- DbgPrint("Found secured slave - has no instances (%s)\n", slave_name(slave));
- if (slave->loaded_package == 0)
+ if (slave->loaded_package == 0) {
+ DbgPrint("Found secured slave - has no instances (%s)\n", slave_name(slave));
return slave;
+ }
} else if (slave->network == network) {
- DbgPrint("slave[%s] %d (net: %d)\n", slave_name(slave), slave->loaded_package, slave->network);
+ DbgPrint("slave[%s] loaded_package[%d] net: [%d]\n", slave_name(slave), slave->loaded_package, slave->network);
if (!strcasecmp(abi, DEFAULT_ABI)) {
if (slave->loaded_package < SLAVE_MAX_LOAD)
return slave;
@@ -963,8 +959,8 @@ HAPI struct slave_node *slave_find_by_pkgname(const char *pkgname)
struct slave_node *slave;
EINA_LIST_FOREACH(s_info.slave_list, l, slave) {
- if (!strcmp(slave->pkgname, pkgname)) {
- if (slave->pid == (pid_t)-1) {
+ if (!strcmp(slave_pkgname(slave), pkgname)) {
+ if (slave_pid(slave) == (pid_t)-1) {
return slave;
}
}
@@ -1010,7 +1006,7 @@ HAPI void slave_unload_package(struct slave_node *slave)
HAPI void slave_load_instance(struct slave_node *slave)
{
slave->loaded_instance++;
- DbgPrint("Instance: (%d)%d\n", slave->pid, slave->loaded_instance);
+ DbgPrint("Instance: (%d)%d\n", slave_pid(slave), slave->loaded_instance);
}
HAPI int const slave_loaded_instance(struct slave_node *slave)
@@ -1031,7 +1027,7 @@ HAPI struct slave_node *slave_unload_instance(struct slave_node *slave)
}
slave->loaded_instance--;
- DbgPrint("Instance: (%d)%d\n", slave->pid, slave->loaded_instance);
+ DbgPrint("Instance: (%d)%d\n", slave_pid(slave), slave->loaded_instance);
if (slave->loaded_instance == 0 && slave_is_activated(slave)) {
slave_set_reactivation(slave, 0);
slave_set_reactivate_instances(slave, 0);
@@ -1067,7 +1063,7 @@ HAPI int slave_set_pid(struct slave_node *slave, pid_t pid)
if (!slave)
return LB_STATUS_ERROR_INVALID;
- DbgPrint("Slave PID is updated to %d from %d\n", pid, slave->pid);
+ DbgPrint("Slave PID is updated to %d from %d\n", pid, slave_pid(slave));
slave->pid = pid;
return LB_STATUS_SUCCESS;
diff --git a/src/slave_rpc.c b/src/slave_rpc.c
index edd6bba..d471a0b 100644
--- a/src/slave_rpc.c
+++ b/src/slave_rpc.c
@@ -352,9 +352,8 @@ static Eina_Bool ping_timeout_cb(void *data)
/*!
* Dead callback will handling this
*/
- DbgPrint("Slave PING TIMEOUT: %s(%d)\n", slave_name(slave), slave_pid(slave));
+ DbgPrint("Slave PING TIMEOUT: %s(%d) : %p\n", slave_name(slave), slave_pid(slave), slave);
slave = slave_deactivated_by_fault(slave);
- DbgPrint("Slave(%p)\n", slave);
return ECORE_CALLBACK_CANCEL;
}
diff --git a/src/util.c b/src/util.c
index 5f0674c..20bbf42 100644
--- a/src/util.c
+++ b/src/util.c
@@ -478,7 +478,7 @@ HAPI int util_unlink_files(const char *folder)
snprintf(abspath, len - 1, "%s/%s", folder, entry->d_name);
if (unlink(abspath) < 0)
- DbgPrint("unlink: %s - %s\n", abspath, strerror(errno));
+ DbgPrint("unlink: %s\n", strerror(errno));
free(abspath);
}
diff --git a/src/utility_service.c b/src/utility_service.c
index 0b7367d..651e284 100644
--- a/src/utility_service.c
+++ b/src/utility_service.c
@@ -182,7 +182,7 @@ static int service_thread_main(struct tcb *tcb, struct packet *packet, void *dat
int ret;
if (!packet) {
- DbgPrint("TCB %p is terminated\n", tcb);
+ DbgPrint("TCB %p is terminated (NIL packet)\n", tcb);
if (tcb == s_info.svc_daemon) {
s_info.svc_daemon = NULL;