ADD_DEFINITIONS("-DSLAVE_PKGNAME=\"com.samsung.data-provider-slave\"")
ADD_DEFINITIONS("-DSLAVE_WEB_PKGNAME=\"com.samsung.data-provider-webslave\"")
+ADD_DEFINITIONS("-DSOCKET_FILE=\"/opt/share/live_magazine/.live.socket\"")
ADD_DEFINITIONS("-DNDEBUG")
#ADD_DEFINITIONS("-DFLOG")
start ()
{
+ rm /opt/share/live_magazine/*
+ rm /tmp/.stop.provider
launch_provider &
}
+data-provider-master (0.6.0) unstable; urgency=low
+
+ * Git: slp/pkgs/d/data-provider-master
+ * Tag: data-provider-master_0.6.0
+
+ -- Sung-jae Park <nicesj.park@samsung.com> Sun, 29 Jul 2012 08:33:05 +0900
+
data-provider-master (0.5.9) unstable; urgency=low
* Git: slp/pkgs/d/data-provider-master
* \note
* For dead signal handler
*/
-extern int client_fault(struct client_node *client);
+extern int client_deactivated_by_fault(struct client_node *client);
extern void client_reset_fault(struct client_node *client);
extern const int const client_is_faulted(const struct client_node *client);
Name: com.samsung.data-provider-master
Summary: Master data provider
-Version: 0.5.9
+Version: 0.6.0
Release: 1
Group: main/app
License: Samsung Proprietary License
}
EINA_LIST_FREE(client->data_list, data) {
+ DbgPrint("Tag is not cleared (%s)\n", data->tag);
free(data->tag);
free(data);
}
Eina_List *n;
int ret;
+ client_ref(client); /*!< Prevent deleting from callback */
EINA_LIST_FOREACH_SAFE(client->event_deactivate_list, l, n, item) {
ret = item->cb(client, item->data);
if (ret < 0) {
}
}
}
+ client_unref(client);
}
-int client_fault(struct client_node *client)
+int client_deactivated_by_fault(struct client_node *client)
{
if (!client || client->faulted)
return 0;
- DbgPrint("Client is faulted(%d), pid(%d)\n", client->refcnt, client->pid);
+ DbgPrint("Client[%p] is faulted(%d), pid(%d)\n", client, client->refcnt, client->pid);
client->faulted = 1;
DbgPrint("Reset PID (%d)\n", client->pid);
{
struct command *command = data;
- if (!packet) {
- if (command->client) {
- DbgPrint("Client fault[%d], discards all response waitings?\n", client_pid(command->client));
- client_fault(command->client);
- //command->client = NULL;
- }
- } else {
+ if (packet) {
int ret;
packet_get(packet, "i", &ret);
}
if (!client_is_activated(command->client)) {
- ErrPrint("Client is not activated, destroy this command\n");
+ ErrPrint("Client[%p] is not activated, destroy this command\n", command->client);
destroy_command(command);
return ECORE_CALLBACK_RENEW;
}
if (client_is_faulted(command->client)) {
- ErrPrint("Client is faulted, discard command\n");
+ ErrPrint("Client[%p] is faulted, discard command\n", command->client);
destroy_command(command);
return ECORE_CALLBACK_RENEW;
}
}
DbgPrint("Send a packet to client [%s]\n", packet_command(command->packet));
- if (com_core_packet_async_send(rpc->handle, command->packet, 0u, recv_cb, command) < 0)
+ if (com_core_packet_async_send(rpc->handle, command->packet, 0.0f, recv_cb, command) < 0) {
+ /*!
+ * \todo
+ * Do we need to handle this error?
+ * Close current connection and make new one?
+ * how about pended command lists?
+ */
destroy_command(command);
+ }
return ECORE_CALLBACK_RENEW;
}
return -EINVAL;
if (client_is_faulted(client)) {
- ErrPrint("Client is faulted\n");
+ ErrPrint("Client[%p] is faulted\n", client);
packet_unref(packet);
return -EFAULT;
}
rpc = client_data(client, "rpc");
if (!rpc)
- ErrPrint("Client is not ready for communication (%s)\n",
- packet_command(packet));
+ ErrPrint("Client[%p] is not ready for communication (%s)\n", client, packet_command(packet));
command = create_command(client, packet);
if (!command) {
DbgPrint("Reset handle for %d\n", client_pid(client));
rpc->handle = -1;
+ DbgPrint("Begin: Destroying command\n");
EINA_LIST_FOREACH_SAFE(s_info.command_list, l, n, command) {
- if (command->client == client)
+ if (command->client == client) {
+ s_info.command_list = eina_list_remove(s_info.command_list, command);
destroy_command(command);
+ }
}
+ DbgPrint("End: Destroying command\n");
return 0;
}
free(rpc);
client_event_callback_del(client, CLIENT_EVENT_DEACTIVATE, deactivated_cb, NULL);
- return -1; /* Return <0, Delete this callback */
+ client_event_callback_del(client, CLIENT_EVENT_DESTROY, del_cb, NULL);
+ return 0; /* Return <0, Delete this callback */
}
int client_rpc_initialize(struct client_node *client, int handle)
#include "util.h"
#include "debug.h"
-#if 0
-int aul_listen_app_dead_signal(int (*)(int, void *), void *);
-
-static int dead_cb(int pid, void *cb_data)
-{
- struct slave_node *slave;
-
- slave = slave_find_by_pid(pid);
- if (slave) {
- slave_deactivated_by_fault(slave);
- } else {
- struct client_node *client;
- client = client_find_by_pid(pid);
- if (client) {
- DbgPrint("Client %d is deactivated\n", client_pid(client));
- client_deactivated_by_fault(client);
- } else {
- ErrPrint("Unknown PID:%d is terminated\n", pid);
- /*!
- * \note
- * Ignore this dead signal
- */
- }
- }
-
- return 0;
-}
-#endif
static int evt_cb(int handle, void *data)
{
struct slave_node *slave;
if (client) {
DbgPrint("Client is disconnected\n");
if (client_pid(client) != (pid_t)-1)
- client_fault(client);
+ client_deactivated_by_fault(client);
return 0;
}
+ DbgPrint("This is not my favor: %d\n", handle);
return 0;
}
}
-
static struct method s_table[] = {
/*!
* \note
int server_init(void)
{
- if (unlink("/tmp/.live.socket") < 0)
+ if (unlink(SOCKET_FILE) < 0)
ErrPrint("unlink: %s\n", strerror(errno));
- s_info.fd = com_core_packet_server_init("/tmp/.live.socket", s_table);
+ s_info.fd = com_core_packet_server_init(SOCKET_FILE, s_table);
if (s_info.fd < 0) {
ErrPrint("Failed to create a server socket\n");
return s_info.fd;
}
- chmod("/tmp/.live.socket", 0666);
+ chmod(SOCKET_FILE, 0666);
return 0;
}
return ECORE_CALLBACK_RENEW;
}
- if (com_core_packet_async_send(rpc->handle, command->packet, 0u, slave_async_cb, command) == 0)
+ if (com_core_packet_async_send(rpc->handle, command->packet, 0.0f, slave_async_cb, command) == 0)
return ECORE_CALLBACK_RENEW;
/*!
* We are failed to send a packet!!!
* Let's try to send this again
*/
+ /*!
+ * \todo
+ * Do we need to handle this error?
+ * Close current connection and make new one?
+ * how about pended command lists?
+ */
DbgPrint("Send this packet again\n");
prepend_command(command);
return ECORE_CALLBACK_RENEW;