impr: Make sure all data is received by MCP bridge

This commit is contained in:
WerWolv
2025-12-27 10:21:29 +01:00
parent 64cbd5fc8d
commit 7df4b1157c
4 changed files with 7 additions and 4 deletions

View File

@@ -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;

View File

@@ -157,8 +157,10 @@ namespace hex::mcp {
log::debug("MCP <---- {}", response.value_or("<Nothing>"));
if (response.has_value())
if (response.has_value()) {
response->push_back(0x00);
return { response->begin(), response->end() };
}
else
return std::vector<u8>{ 0x00 };
}, [this](auto) {

View File

@@ -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);