mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-12-25 18:20:04 +00:00
service: bcat: Check client connection before interacting with socket.
- Fixes a crash when BCAT service is offline.
This commit is contained in:
parent
64f967fd49
commit
363c644730
@ -454,6 +454,16 @@ Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global,
|
|||||||
{std::string("Boxcat-Client-Type"), std::string(BOXCAT_CLIENT_TYPE)},
|
{std::string("Boxcat-Client-Type"), std::string(BOXCAT_CLIENT_TYPE)},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!client.is_valid()) {
|
||||||
|
LOG_ERROR(Service_BCAT, "Client is invalid, going offline!");
|
||||||
|
return StatusResult::Offline;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!client.is_socket_open()) {
|
||||||
|
LOG_ERROR(Service_BCAT, "Failed to open socket, going offline!");
|
||||||
|
return StatusResult::Offline;
|
||||||
|
}
|
||||||
|
|
||||||
const auto response = client.Get(BOXCAT_PATHNAME_EVENTS, headers);
|
const auto response = client.Get(BOXCAT_PATHNAME_EVENTS, headers);
|
||||||
if (response == nullptr)
|
if (response == nullptr)
|
||||||
return StatusResult::Offline;
|
return StatusResult::Offline;
|
||||||
|
Loading…
Reference in New Issue
Block a user