Fix rpc_port_read() function 01/263901/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 13 Sep 2021 07:51:35 +0000 (16:51 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 13 Sep 2021 07:51:35 +0000 (16:51 +0900)
Currently, calling Read() is failed, the port will be disconnected.
The header of the parcel is added to check the procotol validation.
This patch removes to call Disconnect() method when the Read() is failed.

Change-Id: I070d9e361917a0bee6a0cd2f673f7157306af8cb
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/rpc-port.cc

index f4c5a35fda66dd7394e6d56a1eb1b8c9d55e9319..2ed8c892b608804b32da1608191340ad2ea69fb2 100644 (file)
@@ -232,14 +232,12 @@ RPC_API int rpc_port_read(rpc_port_h h, void* buf, unsigned int size) {
   int ret = port->Read(reinterpret_cast<uint32_t*>(&seq), sizeof(seq));
   if (ret < 0) {
     _E("IO Error");
-    port->Disconnect();
     return ret;
   }
 
   ret = port->Read(buf, size);
   if (ret < 0) {
     _E("IO Error");
-    port->Disconnect();
     return ret;
   }