summaryrefslogtreecommitdiff
path: root/src/web_service
diff options
context:
space:
mode:
authorGravatar Lioncash2020-10-13 08:10:50 -0400
committerGravatar Lioncash2020-10-13 13:16:49 -0400
commit39c8d18feba8eafcd43fbb55e73ae150a1947aad (patch)
tree9565ff464bbb9e5a0aa66e6e310098314e88d019 /src/web_service
parentMerge pull request #3929 from FearlessTobi/ticket-keys (diff)
downloadyuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.tar.gz
yuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.tar.xz
yuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.zip
core/CMakeLists: Make some warnings errors
Makes our error coverage a little more consistent across the board by applying it to Linux side of things as well. This also makes it more consistent with the warning settings in other libraries in the project. This also updates httplib to 0.7.9, as there are several warning cleanups made that allow us to enable several warnings as errors.
Diffstat (limited to 'src/web_service')
-rw-r--r--src/web_service/web_backend.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp
index 74e287045..534960d09 100644
--- a/src/web_service/web_backend.cpp
+++ b/src/web_service/web_backend.cpp
@@ -67,28 +67,25 @@ struct Client::Impl {
67 const std::string& jwt = "", const std::string& username = "", 67 const std::string& jwt = "", const std::string& username = "",
68 const std::string& token = "") { 68 const std::string& token = "") {
69 if (cli == nullptr) { 69 if (cli == nullptr) {
70 auto parsedUrl = LUrlParser::clParseURL::ParseURL(host); 70 const auto parsedUrl = LUrlParser::clParseURL::ParseURL(host);
71 int port; 71 int port{};
72 if (parsedUrl.m_Scheme == "http") { 72 if (parsedUrl.m_Scheme == "http") {
73 if (!parsedUrl.GetPort(&port)) { 73 if (!parsedUrl.GetPort(&port)) {
74 port = HTTP_PORT; 74 port = HTTP_PORT;
75 } 75 }
76 cli = std::make_unique<httplib::Client>(parsedUrl.m_Host.c_str(), port);
77 } else if (parsedUrl.m_Scheme == "https") { 76 } else if (parsedUrl.m_Scheme == "https") {
78 if (!parsedUrl.GetPort(&port)) { 77 if (!parsedUrl.GetPort(&port)) {
79 port = HTTPS_PORT; 78 port = HTTPS_PORT;
80 } 79 }
81 cli = std::make_unique<httplib::SSLClient>(parsedUrl.m_Host.c_str(), port);
82 } else { 80 } else {
83 LOG_ERROR(WebService, "Bad URL scheme {}", parsedUrl.m_Scheme); 81 LOG_ERROR(WebService, "Bad URL scheme {}", parsedUrl.m_Scheme);
84 return WebResult{WebResult::Code::InvalidURL, "Bad URL scheme", ""}; 82 return WebResult{WebResult::Code::InvalidURL, "Bad URL scheme", ""};
85 } 83 }
84 cli = std::make_unique<httplib::Client>(parsedUrl.m_Host.c_str(), port);
86 } 85 }
87 if (cli == nullptr) { 86 cli->set_connection_timeout(TIMEOUT_SECONDS);
88 LOG_ERROR(WebService, "Invalid URL {}", host + path); 87 cli->set_read_timeout(TIMEOUT_SECONDS);
89 return WebResult{WebResult::Code::InvalidURL, "Invalid URL", ""}; 88 cli->set_write_timeout(TIMEOUT_SECONDS);
90 }
91 cli->set_timeout_sec(TIMEOUT_SECONDS);
92 89
93 httplib::Headers params; 90 httplib::Headers params;
94 if (!jwt.empty()) { 91 if (!jwt.empty()) {