Fix copying read commands via cast to string 45/180945/1
authorIgor Kotrasinski <i.kotrasinsk@partner.samsung.com>
Wed, 6 Jun 2018 08:09:41 +0000 (10:09 +0200)
committerIgor Kotrasinski <i.kotrasinsk@partner.samsung.com>
Wed, 6 Jun 2018 08:47:59 +0000 (10:47 +0200)
Change-Id: Ie4dff5affd95bcd59694924922d1b01f3123a3de
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
simulatordaemon/inc/TAInstance.h
simulatordaemon/src/TAInstance.cpp

index fce9c31..93d18e9 100644 (file)
@@ -95,7 +95,6 @@ private:
        pthread_mutex_t sendLock;
        stream_protocol::socket mTAConnectionSocket;
        boost::array<char, 1024> readData;
-       vector<char> commandData;
        SIM_COMMAND command;
        states currentState;
        int32_t setSocketOpt(struct timeval timeout);
index 5d69a6e..c57e5f0 100644 (file)
@@ -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