[FIX] reconfigure: send new config to target
authorAnastasia Lyupa <a.lyupa@samsung.com>
Wed, 9 Oct 2013 10:32:05 +0000 (14:32 +0400)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 9 Oct 2013 12:17:42 +0000 (12:17 +0000)
Change-Id: I6c7b8ec90cfa60574b3bd3604fa19b33e65fdb10
Signed-off-by: Anastasia Lyupa <a.lyupa@samsung.com>
daemon/da_protocol.c

index 36f9a74..13acc88 100644 (file)
@@ -1159,6 +1159,10 @@ int host_message_handler(struct msg_t *msg)
        struct conf_t conf;
        enum ErrorCode error_code;
 
+       int target_index;
+       ssize_t sendlen;
+       msg_target_t sendlog;
+
        LOGI("MY HANDLE %s (%X)\n", msg_ID_str(msg->id), msg->id);
        init_parse_control(&msg_control, msg);
 
@@ -1222,6 +1226,21 @@ int host_message_handler(struct msg_t *msg)
                }
                //send ack to host
                sendACKToHost(msg->id, ERR_NO, 0, 0);
+
+               // send config message to target process
+               sendlog.type = MSG_OPTION;
+               sendlog.length = sprintf(sendlog.data, "%lu",
+                                    (unsigned long int) prof_session.conf.use_features0);
+               for (target_index = 0; target_index < MAX_TARGET_COUNT; target_index++)
+               {
+                       if(manager.target[target_index].socket != -1)
+                       {
+                               if (0 > send(manager.target[target_index].socket, &sendlog,
+                                       sizeof(sendlog.type) + sizeof(sendlog.length) + sendlog.length,
+                                            MSG_NOSIGNAL))
+                                       LOGE("fail to send data to target index(%d)\n", target_index);
+                       }
+               }
                break;
        case NMSG_BINARY_INFO:
                return process_msg_binary_info(&msg_control);