add more debug statements, wait for threads before shutting down

This commit is contained in:
Lion Kortlepel
2024-09-22 21:37:52 +02:00
parent 0b589a74c9
commit cd17df5cc2
3 changed files with 38 additions and 13 deletions

View File

@@ -107,8 +107,14 @@ std::string TCPRcv(SOCKET Sock) {
if (Ret.substr(0, 4) == "ABG:") {
auto substr = Ret.substr(4);
auto res = DeComp(std::span<char>(substr.data(), substr.size()));
Ret = std::string(res.data(), res.size());
try {
auto res = DeComp(std::span<char>(substr.data(), substr.size()));
Ret = std::string(res.data(), res.size());
} catch (const std::runtime_error& err) {
// this happens e.g. when we're out of memory, or when we get incomplete data
error("Decompression failed");
return "";
}
}
#ifdef DEBUG