Fix wrong implementation of ClientChannel 33/296733/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 3 Aug 2023 23:55:13 +0000 (08:55 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 3 Aug 2023 23:55:13 +0000 (08:55 +0900)
The once_ member variable must be set while calling constructor.

Change-Id: I1207d0b9c87b5e7ac2a0c68671583dc777f75c83
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/api/amd_api_app_request_broker.cc

index b0812dc..44209fb 100644 (file)
@@ -91,7 +91,8 @@ class ClientChannel : public amd::ClientSocket,
                       public std::enable_shared_from_this<ClientChannel> {
  public:
   ClientChannel(pid_t pid, uid_t uid, bool once = false)
-      : ClientSocket(), pid_(pid), uid_(uid) {
+      : ClientSocket(), pid_(pid), uid_(uid), once_(once) {
+    _W("pid(%d), uid(%u), once(%d), fd(%d)", pid_, uid_, once_, GetFd());
     auto* channel = g_io_channel_unix_new(GetFd());
     if (channel == nullptr) {
       _E("g_io_channel_unix_new() is failed");
@@ -123,6 +124,7 @@ class ClientChannel : public amd::ClientSocket,
   }
 
   ~ClientChannel() {
+    _W("pid(%d), uid(%u), once(%d), fd(%d)", pid_, uid_, once_, GetFd());
     if (channel_)
       g_io_channel_unref(channel_);
 
@@ -274,6 +276,7 @@ gboolean ClientChannel::OnDataReceived(GIOChannel* channel, GIOCondition cond,
   if (ret != 0)
     res = -ECOMM;
 
+  _W("pid(%d), result(%d)", handle->GetPid(), ret);
   if (!handle->IsEmpty()) {
     auto result_cb = handle->Pop();
     if (result_cb != nullptr)