diff options
-rw-r--r-- | src/components/application_manager/include/application_manager/rpc_passing_handler.h | 2 | ||||
-rw-r--r-- | src/components/application_manager/src/rpc_passing_handler.cc | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/components/application_manager/include/application_manager/rpc_passing_handler.h b/src/components/application_manager/include/application_manager/rpc_passing_handler.h index ab85b1374f..675d567820 100644 --- a/src/components/application_manager/include/application_manager/rpc_passing_handler.h +++ b/src/components/application_manager/include/application_manager/rpc_passing_handler.h @@ -82,7 +82,7 @@ class RPCPassingHandler { * @brief Function to handle sending and receiving RPC Passing * requests/responses * @param rpc_message RPC message SmartObject - * @return true if the request was forwarded, false otherwise + * @return true if the request was handled, false otherwise */ bool RPCPassThrough(smart_objects::SmartObject rpc_message); diff --git a/src/components/application_manager/src/rpc_passing_handler.cc b/src/components/application_manager/src/rpc_passing_handler.cc index 37b01a92f6..3e90b86663 100644 --- a/src/components/application_manager/src/rpc_passing_handler.cc +++ b/src/components/application_manager/src/rpc_passing_handler.cc @@ -118,8 +118,20 @@ bool RPCPassingHandler::RPCPassThrough(smart_objects::SmartObject rpc_message) { PopulateRPCRequestQueue(rpc_message); } else { rpc_request_queue_lock_.Release(); - LOG4CXX_DEBUG(logger_, "Correlation id DOES exist in map. Continuing"); - return false; + LOG4CXX_DEBUG(logger_, "Correlation id DOES exist in map. Returning"); + std::shared_ptr<smart_objects::SmartObject> response( + MessageHelper::CreateNegativeResponse( + rpc_message[strings::params][strings::connection_key].asInt(), + rpc_message[strings::params][strings::function_id].asInt(), + correlation_id, + mobile_apis::Result::INVALID_ID)); + + (*response)[strings::msg_params][strings::info] = + "Duplicate correlation_id"; + app_manager_.GetRPCService().ManageMobileCommand( + response, commands::Command::SOURCE_SDL); + + return true; } rpc_request_queue_lock_.Acquire(); |