Send pid for rpc-port request upon setting pending item pid 98/315498/2
authorChanggyu Choi <changyu.choi@samsung.com>
Mon, 2 Dec 2024 10:13:01 +0000 (19:13 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Mon, 2 Dec 2024 10:21:08 +0000 (19:21 +0900)
For RPC_PORT_PREPARE_STUB, amd sends results faster.

Change-Id: Ic2ebf3c14b19e9d8ea22ec82f423c2619c20c1ed
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/lib/request/pending_item.cc

index d60e2b660dabe9ad30fca8a6039e71211959712c..315c9444eb6f79027e23d821ffba6c1e2124fa27 100644 (file)
@@ -48,6 +48,12 @@ pid_t PendingItem::GetCallerPid() const {
 
 void PendingItem::SetPid(pid_t pid) {
   pid_ = pid;
+  for (auto& req : requests_) {
+    if (req->GetRequestType() == "rpc-port") {
+      req->UnsetTimer();
+      req->SendResult(pid);
+    }
+  }
 }
 
 pid_t PendingItem::GetPid() const {