If the livebox_del is called before created,
authorSung-jae Park <nicesj.park@samsung.com>
Sat, 18 Jan 2014 14:45:00 +0000 (23:45 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Sat, 18 Jan 2014 15:21:59 +0000 (00:21 +0900)
viewer cannot send the id of an instance.
in that case, the viewer should send the timestamp.
Then the master will find an instance using timestamp, if ID is not specified.

Change-Id: I1d8a97ab05a0882627975b19d02b7f8ade3e0fdd

packaging/liblivebox-viewer.spec
src/client.c
src/livebox.c

index 2e71f2e..7926769 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-viewer
 Summary: Library for developing the application
-Version: 0.20.2
+Version: 0.20.3
 Release: 1
 Group: HomeTF/Livebox
 License: Flora
index 232d785..7ae94e1 100644 (file)
@@ -1463,7 +1463,6 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
 
 out:
        if (ret == 0 && old_state == DELETE) {
-               int delete_event_sent = 0;
                int cnt;
 
                DbgPrint("Take place unexpected case\n");
@@ -1473,7 +1472,7 @@ out:
                        handler = dlist_data(l);
 
                        if (handler->cbs.created.cb) {
-                               if (delete_event_sent == 0) {
+                               if (!handler->common->request.deleted) {
                                        if (lb_send_delete(handler, common->delete_type, handler->cbs.created.cb, handler->cbs.created.data) < 0) {
                                                /*!
                                                 * \note
@@ -1481,9 +1480,7 @@ out:
                                                 * Callback will be called in any cases
                                                 */
                                        }
-
-                                       delete_event_sent = 1;
-                               } else {
+                               } else if (handler->state != DELETE) {
                                        handler->cbs.created.cb(handler, LB_STATUS_ERROR_CANCEL, handler->cbs.created.data);
                                        lb_unref(handler, 1);
                                }
index 16674b7..4ebd55a 100644 (file)
@@ -4459,7 +4459,7 @@ int lb_send_delete(struct livebox *handler, int type, ret_cb_t cb, void *data)
                cb = default_delete_cb;
        }
 
-       packet = packet_create("delete", "ssi", handler->common->pkgname, handler->common->id, type);
+       packet = packet_create("delete", "ssid", handler->common->pkgname, handler->common->id, type, handler->common->timestamp);
        if (!packet) {
                ErrPrint("Failed to build a param\n");
                if (cb) {