Fix Session Addition for DebugPort 12/264612/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 27 Sep 2021 07:32:48 +0000 (16:32 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 27 Sep 2021 07:32:48 +0000 (16:32 +0900)
To reduce the error log print related to debug-port, calling AddSession()
is moved.

Change-Id: Iaf3f064d12054fa108d99ae796502043aeae801c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/proxy-internal.cc
src/stub-internal.cc

index 22f99a8..91cb63e 100644 (file)
@@ -264,8 +264,8 @@ int Proxy::ConnectSync(std::string appid, std::string port_name,
 
   main_port_.reset(new ProxyPort(this, fds_[0], target_appid_, false));
   delegate_port_.reset(new ProxyPort(this, fds_[1], target_appid_));
-  listener_->OnConnected(target_appid_, main_port_.get());
   DebugPort::GetInst()->AddSession(port_name, target_appid_, fds_[0], fds_[1]);
+  listener_->OnConnected(target_appid_, main_port_.get());
   return RPC_PORT_ERROR_NONE;
 }
 
@@ -751,9 +751,9 @@ gboolean Proxy::Client::OnResponseReceived(GIOChannel* channel,
     proxy->fds_[1] = client_fd;
     proxy->delegate_port_.reset(
         new ProxyPort(proxy, proxy->fds_[1], proxy->target_appid_));
-    listener->OnConnected(proxy->target_appid_, proxy->main_port_.get());
     DebugPort::GetInst()->AddSession(proxy->port_name_, proxy->target_appid_,
         proxy->fds_[0], proxy->fds_[1]);
+    listener->OnConnected(proxy->target_appid_, proxy->main_port_.get());
     _W("target_appid(%s), port_name(%s), main_fd(%d), delegate_fd(%d)",
         proxy->target_appid_.c_str(), proxy->port_name_.c_str(),
         proxy->fds_[0], proxy->fds_[1]);
index 48fe4a3..f16035c 100644 (file)
@@ -259,8 +259,8 @@ void Stub::AddAcceptedPort(const std::string& sender_appid,
 
   _W("sender_appid(%s), instance(%s), main_fd(%d), delegate_fd(%d)",
       sender_appid.c_str(), instance.c_str(), main_fd, fd);
-  listener_->OnConnected(sender_appid, instance);
   DebugPort::GetInst()->AddSession(port_name_, sender_appid, main_fd, fd);
+  listener_->OnConnected(sender_appid, instance);
 }
 
 std::recursive_mutex& Stub::GetMutex() const {