diff options
author | bunnei <bunneidev@gmail.com> | 2020-10-29 01:18:33 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-10-29 01:19:12 +0100 |
commit | 156556ddd2128e8e9a73a7166985639228015bcf (patch) | |
tree | 00dfd9e9aa7ab449664202a8a1ed9e988cd9ceaf /src/web_service | |
parent | Merge pull request #4855 from bunnei/cdma-pusher-log-fix (diff) | |
download | yuzu-156556ddd2128e8e9a73a7166985639228015bcf.tar yuzu-156556ddd2128e8e9a73a7166985639228015bcf.tar.gz yuzu-156556ddd2128e8e9a73a7166985639228015bcf.tar.bz2 yuzu-156556ddd2128e8e9a73a7166985639228015bcf.tar.lz yuzu-156556ddd2128e8e9a73a7166985639228015bcf.tar.xz yuzu-156556ddd2128e8e9a73a7166985639228015bcf.tar.zst yuzu-156556ddd2128e8e9a73a7166985639228015bcf.zip |
Diffstat (limited to 'src/web_service')
-rw-r--r-- | src/web_service/web_backend.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index c56cd7c71..f264b98a0 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp @@ -65,6 +65,17 @@ struct Client::Impl { if (cli == nullptr) { cli = std::make_unique<httplib::Client>(host.c_str()); } + + if (!cli->is_valid()) { + LOG_ERROR(WebService, "Client is invalid, skipping request!"); + return {}; + } + + if (!cli->is_socket_open()) { + LOG_ERROR(WebService, "Failed to open socket, skipping request!"); + return {}; + } + cli->set_connection_timeout(TIMEOUT_SECONDS); cli->set_read_timeout(TIMEOUT_SECONDS); cli->set_write_timeout(TIMEOUT_SECONDS); |