diff options
author | LC <mathew1800@gmail.com> | 2020-10-29 01:46:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-29 01:46:28 +0100 |
commit | c20569ebdf1a147acb706de282808696bbc1468c (patch) | |
tree | 00dfd9e9aa7ab449664202a8a1ed9e988cd9ceaf | |
parent | Merge pull request #4855 from bunnei/cdma-pusher-log-fix (diff) | |
parent | web_service: web_backend: Handle socket errors with GenericRequest. (diff) | |
download | yuzu-c20569ebdf1a147acb706de282808696bbc1468c.tar yuzu-c20569ebdf1a147acb706de282808696bbc1468c.tar.gz yuzu-c20569ebdf1a147acb706de282808696bbc1468c.tar.bz2 yuzu-c20569ebdf1a147acb706de282808696bbc1468c.tar.lz yuzu-c20569ebdf1a147acb706de282808696bbc1468c.tar.xz yuzu-c20569ebdf1a147acb706de282808696bbc1468c.tar.zst yuzu-c20569ebdf1a147acb706de282808696bbc1468c.zip |
Diffstat (limited to '')
-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); |