From 83c47706e665cd04937a4cfe1644a59b88fc7900 Mon Sep 17 00:00:00 2001 From: Igor Kotrasinski Date: Wed, 6 Jun 2018 10:09:41 +0200 Subject: [PATCH] Fix copying read commands via cast to string Change-Id: Ie4dff5affd95bcd59694924922d1b01f3123a3de Signed-off-by: Igor Kotrasinski --- simulatordaemon/inc/TAInstance.h | 1 - simulatordaemon/src/TAInstance.cpp | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/simulatordaemon/inc/TAInstance.h b/simulatordaemon/inc/TAInstance.h index fce9c31..93d18e9 100644 --- a/simulatordaemon/inc/TAInstance.h +++ b/simulatordaemon/inc/TAInstance.h @@ -95,7 +95,6 @@ private: pthread_mutex_t sendLock; stream_protocol::socket mTAConnectionSocket; boost::array readData; - vector commandData; SIM_COMMAND command; states currentState; int32_t setSocketOpt(struct timeval timeout); diff --git a/simulatordaemon/src/TAInstance.cpp b/simulatordaemon/src/TAInstance.cpp index 5d69a6e..c57e5f0 100644 --- a/simulatordaemon/src/TAInstance.cpp +++ b/simulatordaemon/src/TAInstance.cpp @@ -322,17 +322,9 @@ void TAInstance::handleRead(const boost::system::error_code& error, } //case case DATA_READ: { - // At this pouint32_t data is completely read - // clear the vector for the first time and copy server data received - commandData.clear(); - for (uint32_t i = 0; i < readData.size(); i++) { - commandData.push_back(readData.at(i)); - } - string tempData(commandData.begin(), commandData.end()); - // Get the Session object ResCommandBasePtr ptr = ResMakeCommand::getCommand(command, - (void*)tempData.c_str(), &mSessionMap); + (void*) readData.data(), &mSessionMap); if (!ptr == false) { // Call the Session object to handle commands -- 2.7.4