diff options
Diffstat (limited to 'src/web_service')
| -rw-r--r-- | src/web_service/web_backend.cpp | 4 | ||||
| -rw-r--r-- | src/web_service/web_result.h | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index 4208bd044..58b0c2f10 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp | |||
| @@ -32,7 +32,7 @@ constexpr std::size_t TIMEOUT_SECONDS = 30; | |||
| 32 | struct Client::Impl { | 32 | struct Client::Impl { |
| 33 | Impl(std::string host, std::string username, std::string token) | 33 | Impl(std::string host, std::string username, std::string token) |
| 34 | : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} { | 34 | : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} { |
| 35 | std::lock_guard lock{jwt_cache.mutex}; | 35 | std::scoped_lock lock{jwt_cache.mutex}; |
| 36 | if (this->username == jwt_cache.username && this->token == jwt_cache.token) { | 36 | if (this->username == jwt_cache.username && this->token == jwt_cache.token) { |
| 37 | jwt = jwt_cache.jwt; | 37 | jwt = jwt_cache.jwt; |
| 38 | } | 38 | } |
| @@ -147,7 +147,7 @@ struct Client::Impl { | |||
| 147 | if (result.result_code != WebResult::Code::Success) { | 147 | if (result.result_code != WebResult::Code::Success) { |
| 148 | LOG_ERROR(WebService, "UpdateJWT failed"); | 148 | LOG_ERROR(WebService, "UpdateJWT failed"); |
| 149 | } else { | 149 | } else { |
| 150 | std::lock_guard lock{jwt_cache.mutex}; | 150 | std::scoped_lock lock{jwt_cache.mutex}; |
| 151 | jwt_cache.username = username; | 151 | jwt_cache.username = username; |
| 152 | jwt_cache.token = token; | 152 | jwt_cache.token = token; |
| 153 | jwt_cache.jwt = jwt = result.returned_data; | 153 | jwt_cache.jwt = jwt = result.returned_data; |
diff --git a/src/web_service/web_result.h b/src/web_service/web_result.h index 3aeeb5288..6da3a9277 100644 --- a/src/web_service/web_result.h +++ b/src/web_service/web_result.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2018 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||