Browse Source
Merge pull request #4797 from bunnei/bcat-errors
service: bcat: Check client connection before interacting with socket.
pull/15/merge
bunnei
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
10 additions and
0 deletions
-
src/core/hle/service/bcat/backend/boxcat.cpp
|
|
|
@ -454,6 +454,16 @@ Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global, |
|
|
|
{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); |
|
|
|
if (response == nullptr) |
|
|
|
return StatusResult::Offline; |
|
|
|
|