fix(launch): Fix several launch failure conditions (exceptions thrown in child.wait, and boost::split_unix) (#4390)

This commit is contained in:
Martijn Courteaux 2025-11-12 16:07:15 +01:00 committed by GitHub
commit 852dee0a68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 5 deletions

View file

@ -40,6 +40,8 @@ using namespace std::literals;
namespace nvhttp {
static constexpr std::string_view EMPTY_PROPERTY_TREE_ERROR_MSG = "Property tree is empty. Probably, control flow got interrupted by an unexpected C++ exception. This is a bug in Sunshine. Moonlight-qt will report Malformed XML (missing root element)."sv;
namespace fs = std::filesystem;
namespace pt = boost::property_tree;
@ -816,6 +818,10 @@ namespace nvhttp {
auto g = util::fail_guard([&]() {
std::ostringstream data;
if (tree.empty()) {
BOOST_LOG(error) << EMPTY_PROPERTY_TREE_ERROR_MSG;
}
pt::write_xml(data, tree);
response->write(data.str());
response->close_connection_after_response = true;
@ -922,6 +928,10 @@ namespace nvhttp {
auto g = util::fail_guard([&]() {
std::ostringstream data;
if (tree.empty()) {
BOOST_LOG(error) << EMPTY_PROPERTY_TREE_ERROR_MSG;
}
pt::write_xml(data, tree);
response->write(data.str());
response->close_connection_after_response = true;