From 14ed0ca36719a1acc59a7d72d8d10bcd77b8b736 Mon Sep 17 00:00:00 2001 From: zzyyyl Date: Tue, 27 Sep 2022 19:10:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8A=A0=E7=82=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=EF=BC=8Ctimeout=20=E6=97=B6=E5=BC=BA=E5=88=B6=E4=B8=AD?= =?UTF-8?q?=E6=AD=A2=20hProcess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAssistant/Controller.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/MeoAssistant/Controller.cpp b/src/MeoAssistant/Controller.cpp index 1a884919c3..ec1f2e45f3 100644 --- a/src/MeoAssistant/Controller.cpp +++ b/src/MeoAssistant/Controller.cpp @@ -286,6 +286,25 @@ std::optional asst::Controller::call_command(const std::string& cmd } else if (wait_result == WAIT_TIMEOUT) { if (wait_time == 0) { + std::vector handle_string {}; + for (auto handle : wait_handles) { + if (handle == process_info.hProcess) { + handle_string.emplace_back("process_info.hProcess"); + } + else if (handle == pipeov.hEvent) { + handle_string.emplace_back("pipeov.hEvent"); + } + else if (recv_by_socket && handle == sockov.hEvent) { + handle_string.emplace_back("sockov.hEvent"); + } + else { + handle_string.emplace_back("UnknownHandle"); + } + } + Log.warn("Wait handles:", handle_string, "timeout."); + if (process_running) { + TerminateProcess(process_info.hProcess, 0); + } break; } continue;