From 7df4b1157cda0daae5e1fb7a5650497598797467 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 27 Dec 2025 10:21:29 +0100 Subject: [PATCH] impr: Make sure all data is received by MCP bridge --- lib/external/libwolv | 2 +- lib/libimhex/source/mcp/client.cpp | 4 ++-- lib/libimhex/source/mcp/server.cpp | 4 +++- main/gui/source/crash_handlers.cpp | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/external/libwolv b/lib/external/libwolv index b0c941656..055e14780 160000 --- a/lib/external/libwolv +++ b/lib/external/libwolv @@ -1 +1 @@ -Subproject commit b0c9416568475a784838e3af8b0021a542e47cd7 +Subproject commit 055e14780489e22c82eff752807341fd90d1c596 diff --git a/lib/libimhex/source/mcp/client.cpp b/lib/libimhex/source/mcp/client.cpp index 46f85cf98..b5278562b 100644 --- a/lib/libimhex/source/mcp/client.cpp +++ b/lib/libimhex/source/mcp/client.cpp @@ -33,9 +33,9 @@ namespace hex::mcp { } client.writeString(request); - auto response = client.readString(4_MiB); + auto response = client.readBytesUntil(0x00); if (!response.empty() && response.front() != 0x00) - output << response << '\n'; + output << std::string(response.begin(), response.end()) << '\n'; if (!client.isConnected()) break; diff --git a/lib/libimhex/source/mcp/server.cpp b/lib/libimhex/source/mcp/server.cpp index c6151627b..8ed67fe30 100644 --- a/lib/libimhex/source/mcp/server.cpp +++ b/lib/libimhex/source/mcp/server.cpp @@ -157,8 +157,10 @@ namespace hex::mcp { log::debug("MCP <---- {}", response.value_or("")); - if (response.has_value()) + if (response.has_value()) { + response->push_back(0x00); return { response->begin(), response->end() }; + } else return std::vector{ 0x00 }; }, [this](auto) { diff --git a/main/gui/source/crash_handlers.cpp b/main/gui/source/crash_handlers.cpp index 316f5c5e3..4cbbec01b 100644 --- a/main/gui/source/crash_handlers.cpp +++ b/main/gui/source/crash_handlers.cpp @@ -218,6 +218,7 @@ namespace hex::crash { HANDLE_SIGNAL(SIGILL); HANDLE_SIGNAL(SIGABRT); HANDLE_SIGNAL(SIGFPE); + HANDLE_SIGNAL(SIGINT) #if defined (SIGBUS) HANDLE_SIGNAL(SIGBUS);