#include "conf.h"
#ifndef SVC_PKG
-#define SVC_PKG "org.tizen.data-provider-slave.icon"
+#define SVC_PKG "com.samsung.data-provider-slave.icon"
#endif
#ifndef LAUNCH_TIMEOUT
ctx->seq = seq;
s_info.context_list = eina_list_append(s_info.context_list, ctx);
+
return LB_STATUS_SUCCESS;
}
int ret;
EINA_LIST_FREE(s_info.pending_list, item) {
- ret = service_common_unicast_packet(s_info.svc_daemon, item->packet);
+ if (tcb_is_valid(s_info.svc_ctx, s_info.svc_daemon) >= 0) {
+ ret = service_common_unicast_packet(s_info.svc_daemon, item->packet);
+ } else {
+ ret = -EFAULT;
+ }
+
if (ret < 0) {
- struct packet *reply;
- reply = packet_create_reply(item->packet, "i", ret);
- if (service_common_unicast_packet(item->tcb, reply) < 0) {
- ErrPrint("Unable to send packet\n");
+ if (tcb_is_valid(s_info.svc_ctx, item->tcb) >= 0) {
+ struct packet *reply;
+ reply = packet_create_reply(item->packet, "i", ret);
+ if (service_common_unicast_packet(item->tcb, reply) < 0) {
+ ErrPrint("Unable to send packet\n");
+ }
+ packet_destroy(reply);
}
- packet_destroy(reply);
} else {
put_reply_tcb(item->tcb, packet_seq(item->packet));
}
struct packet *reply;
EINA_LIST_FREE(s_info.pending_list, item) {
- reply = packet_create_reply(item->packet, "i", -EFAULT);
- if (!reply) {
- ErrPrint("Unable to create a packet\n");
- } else {
- int ret;
+ if (tcb_is_valid(s_info.svc_ctx, item->tcb) >= 0) {
+ reply = packet_create_reply(item->packet, "i", -EFAULT);
+ if (!reply) {
+ ErrPrint("Unable to create a packet\n");
+ } else {
+ int ret;
+
+ ret = service_common_unicast_packet(item->tcb, reply);
+ if (ret < 0) {
+ ErrPrint("Failed to send reply packet: %d\n", ret);
+ }
- ret = service_common_unicast_packet(item->tcb, reply);
- if (ret < 0) {
- ErrPrint("Failed to send reply packet: %d\n", ret);
+ packet_destroy(reply);
}
-
- packet_destroy(reply);
+ } else {
+ ErrPrint("TCB is already terminated\n");
}
packet_unref(item->packet);
if (ret < 0) {
goto reply_out;
}
- } else {
+ } else if (tcb_is_valid(s_info.svc_ctx, s_info.svc_daemon) >= 0) {
ret = service_common_unicast_packet(s_info.svc_daemon, packet);
if (ret <0) {
goto reply_out;
tcb = get_reply_tcb(packet_seq(packet));
if (!tcb) {
ErrPrint("Unable to find reply tcb\n");
- } else {
- ret = service_common_unicast_packet(tcb, packet);
- if (ret < 0) {
- ErrPrint("Unable to forward the reply packet\n");
- }
+ break;
+ }
+
+ if (tcb_is_valid(s_info.svc_ctx, tcb) < 0) {
+ ErrPrint("TCB is not valid\n");
+ break;
+ }
+
+ ret = service_common_unicast_packet(tcb, packet);
+ if (ret < 0) {
+ ErrPrint("Unable to forward the reply packet\n");
}
break;
default: