From e4173d73c12317eb28e418a17bc77bfa13e13f26 Mon Sep 17 00:00:00 2001 From: Anastasia Lyupa Date: Wed, 9 Oct 2013 14:32:05 +0400 Subject: [PATCH] [FIX] reconfigure: send new config to target Change-Id: I6c7b8ec90cfa60574b3bd3604fa19b33e65fdb10 Signed-off-by: Anastasia Lyupa --- daemon/da_protocol.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/daemon/da_protocol.c b/daemon/da_protocol.c index 36f9a74..13acc88 100644 --- a/daemon/da_protocol.c +++ b/daemon/da_protocol.c @@ -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); -- 2.7.4