Commit graph

29 commits

Author SHA1 Message Date
Morph
56114589a6 web_service: Eliminate variable shadowing 2022-06-13 18:19:22 -04:00
Merry
41af59a6cb web_service: Replace lock_guard with scoped_lock 2022-04-07 19:44:07 +01:00
ameerj
b51d9c043a web_service: Reduce unused includes 2022-03-20 02:25:09 -04:00
ReinUsesLisp
89398ddbf4 web_service: Silence -Wmaybe-uninitialized on httplib.h 2021-07-12 03:30:45 -03:00
Vortex
b0965d25b9 externals: httplib: replace custom httplib header with upstream as submodule.
This also includes a minor change to web_service.cpp - to fix compatibility with upstream changes.
2021-06-19 02:18:58 +05:30
liushuyu
0555d8ac94 web_service: follow-up fix to #4842 ...
* The web_service http request is now fixed on Windows (R) platform.
* The issue is due to a complicated race-condition in `httplib`, a detailed
  explanation is available at https://github.com/yhirose/cpp-httplib/pull/701
* A pending Pull Request on `httplib` has been applied to remedy the
  said race-condition.
* The socket availability check is removed due to a behavioral chice of
  `httplib` that a socket will not be created before any actual request
  is sent.
2020-10-28 23:16:06 -06:00
bunnei
529f48d980 web_service: web_backend: Handle socket errors with GenericRequest.
- Fixes a shutdown crash when we try to submit telemetry if there is a service issue.
2020-10-28 17:19:12 -07:00
liushuyu
6be4451e39 web_backend: fix a regression introduced in 16de0a6
* A regression was in 16de0a6 and token verification function was
  broken.
* The reason being `httplib` now requires OpenSSL 1.1+ API while
  LibreSSL 2.x provided OpenSSL 1.0 compatible API.
* The bundled LibreSSL has been updated to 3.2.2 so it now provides
  OpenSSL 1.1 compatible API now.
* Also the path hint has been added so that it will find the correct
  path to the CA certs on *nix systems.
* An option is provided so that *nix system distributions/providers can
  use their own SSL implementations when compiling Yuzu/Citra to
  (hopefully) complies with their maintenance guidelines.
* LURLParse is also removed since `httplib` can handle
  `scheme:host:port` string itself now.
2020-10-27 02:57:19 -06:00
Lioncash
16de0a6a96 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.
2020-10-13 13:16:49 -04:00
Lioncash
77d6d3bf4b web_service: Move web_result.h into web_service
This is the only place it's actively used. It's also more appropriate
for web-related structures to be within the web service target.
Especially given this one doesn't rely on anything in the common
library.
2020-08-22 19:29:54 -04:00
Lioncash
02e095313a CMakeLists: Specify -Wextra on linux builds
Allows reporting more cases where logic errors may exist, such as
implicit fallthrough cases, etc.

We currently ignore unused parameters, since we currently have many
cases where this is intentional (virtual interfaces).

While we're at it, we can also tidy up any existing code that causes
warnings. This also uncovered a few bugs as well.
2020-04-15 21:33:46 -04:00
Brian Clinkenbeard
050a4362ad httplib compatibility 2020-02-18 18:04:33 -08:00
bunnei
9637883799 web-service: Port citra's updated web_backend code. 2019-11-09 14:00:44 -05:00
Lioncash
eb88e9d088 general: Use deducation guides for std::lock_guard and std::unique_lock
Since C++17, the introduction of deduction guides for locking facilities
means that we no longer need to hardcode the mutex type into the locks
themselves, making it easier to switch mutex types, should it ever be
necessary in the future.
2019-04-01 12:53:47 -04:00
Lioncash
c0350fb7b7 web_service: Remove unnecessary inclusions
Reduces the potential amount of rebuilding necessary if any headers
change. In particular, we were including a header from the core library
when we don't even link the core library to the web_service library, so
this also gets rid of an indirect dependency.
2019-03-02 14:58:49 -05:00
Lioncash
2619abec47 web_backend: Make Client use the PImpl idiom
Like with TelemetryJson, we can make the implementation details private
and avoid the need to expose httplib to external libraries that need to
use the Client class.
2018-10-10 22:29:35 -04:00
fearlessTobi
cd5b9645a4 Review comments -part 4 2018-10-02 15:30:49 +02:00
Weiyi Wang
2b4cefc8f9 web_backend: protect jwt cache with a mutex 2018-10-02 15:30:48 +02:00
fearlessTobi
fb46c8b426 Address a bunch of review comments 2018-10-02 15:30:48 +02:00
fearlessTobi
92e939952c Port web_service from Citra 2018-10-02 15:30:48 +02:00
James Rowe
5dbd091a80 Massive removal of unused modules 2018-01-12 19:11:03 -07:00
B3n30
fdd8a6ef0c WebService: Verify username and token (#2930)
* WebService: Verify username and token; Log errors in PostJson

* Fixup: added docstrings to the functions

* Webservice: Added Icons to the verification, imrpved error detection in cpr, fixup nits

* fixup: fmt warning
2017-09-18 21:18:26 -04:00
bunnei
2c616c7f45 web_backend: Fix CPR bug where Winsock is not properly initializing. 2017-08-26 19:45:41 -04:00
bunnei
85bfee814a web_backend: Fix asynchronous JSON post by spawning new thread. 2017-08-25 23:37:47 -04:00
bunnei
0783d36b5a web_services: Refactor to remove dependency on Core. 2017-08-25 23:10:02 -04:00
bunnei
5dddc43fde web_backend: User config for username and token, support anonymous post. 2017-08-25 23:10:01 -04:00
bunnei
425200bca5 web_backend: Specify api-version on JSON post. 2017-07-11 18:34:30 -04:00
bunnei
07f0f623d1 web_backend: Add initial interface to POST data to Citra Web Services. 2017-07-11 18:33:25 -04:00
bunnei
061f10e286 web_service: Add skeleton project. 2017-07-10 00:15:40 -04:00