Commit Graph
142 Commits
Author SHA1 Message Date
Le Philousophe 87e9a406fa BACKENDS: NETWORKING: Use Path instead of String for local files
Use references when applicable too.
2023-12-24 13:19:25 +01:00
Le Philousophe d87571766e BACKENDS: NETWORKING: Use Path for cURL requests 2023-12-24 13:19:25 +01:00
Le Philousophe b23e06c4cd BACKENDS: NETWORKING: Properly handle request abortion
Finish the request with an error.
Remove a useless check as handle is never called when state is not
PROCESSING
2023-12-10 11:43:58 +01:00
Le Philousophe e9e89f0a70 BACKENDS: NETWORKING: Don't handle request if it's not processing
This avoids an error when aborting a request which notifies on a
disappeared dialog and raises a SIGSEGV
2023-12-09 23:59:06 +01:00
Le Philousophe 0043d344a9 BACKENDS: Avoid passing arguments by value in cloud and networking
Use references everywhere it's possible.
Use override keyword to raise errors when there are discrepancies.
2023-10-29 01:51:38 +02:00
Little Cat f49e1de5c2 BACKENDS: CURL: Raise debug log level to 3. 2023-10-24 22:20:22 -03:00
Le Philousophe a68e8fcea8 ANDROID: Fix CA path retrieval
The old way doesn't work anymore since directories are not FSNode.
The SearchMan could also return files which were not accessible through
filesystem.
2023-08-12 22:12:59 +02:00
Le Philousophe fde8a0b463 NETWORKING: Use a String for CA path
This allows to build the path inside the function and return it.
2023-08-12 22:12:58 +02:00
hax0kartik 6575c1cca8 CLOUD: Fix memleak in ConnectionManager 2023-08-04 17:48:11 +02:00
hax0kartik d7ada7488b CLOUD: Fix memleak in CurlRequest 2023-08-04 16:35:21 +02:00
hax0kartik 05a4989bb5 CLOUD: Fix memleak due to addedRequests not being cleared 2023-08-04 16:35:21 +02:00
Alexander Tkachov cc38b31ae7 CLOUD: Janitorial
- rename JSON::getPreparedContents() to JSON::untaintContents();
- minor changes to ConnectCloudClientHandler and CloudConnectionWizard.
2023-04-08 16:20:11 +02:00
Alexander Tkachov 3606a75db1 NETWORKING: Move getPreparedContents() to Common::JSON
Made the method that prepares the JSON received via network static and moved to Common::JSON, so it could be used not only in CurlJsonRequest.
2023-04-08 16:20:11 +02:00
Le Philousophe ecc050e83c ANDROID: Bundle cacert.pem and don't disable certificate checks 2023-04-02 11:39:44 +02:00
Little Cat 8df9779e22 SCUMM HE: Add command and re-add endline 2023-03-31 06:08:58 -03:00
Little Cat 33bfcd6eac SCUMM HE: Disable cert verification on Android. 2023-03-31 05:14:44 -03:00
Donovan Watteau 4c83c15a11 BACKENDS: CURL: Fix -Wformat warning 2023-03-09 15:43:52 +01:00
Donovan Watteau ae2b3181f3 BACKENDS: CURL: Fix libcurl redefining ARRAYSIZE on Win32
As done in commit 272d4105b2.
2023-03-09 14:52:58 +01:00
D G Turner a77091faa9 BACKENDS: CURL: Fix Deprecated API Warnings By Removing Usage on v7.45.0+ 2023-03-07 23:40:54 +01:00
Le Philousophe 1d2ffda577 BACKENDS: CURL: Fix build with old curl versions 2023-03-07 13:37:42 +01:00
Little Cat f2dac5e9b3 BACKENDS: CURL: Document URL methods. 2023-03-06 00:07:13 +01:00
Little Cat 11d9631003 BACKENDS: CURL: Add missing end lines. 2023-03-06 00:07:13 +01:00
Little Cat f9f2023b2a BACKENDS: ENET: Fix space indentation to tab. 2023-03-06 00:07:13 +01:00
Little Cat 84866701b7 BACKENDS: CURL: Timeout if send/recv takes too long 2023-03-06 00:07:13 +01:00
Little Cat 1cf1f302ad BACKENDS: LIBCURL: URL Parsing. 2023-03-06 00:07:13 +01:00
Little Cat 3e29d0bea4 BACKENDS: CURL: Fix compiling on Windows. 2023-03-06 00:07:13 +01:00
Little Cat f42930ba66 BACKENDS: CURL: Ability to create raw sockets.
This can be used to create custom protocols with an SDL_net like
interface while being able to connect to SSL/TLS servers.
2023-03-06 00:07:13 +01:00
Le Philousophe 98a0aab3f4 BACKENDS: NETWORKING: Set pointer to nullptr when it's deleted
This avoids a UAF when file failed to open.
2023-02-26 12:20:13 +01:00
Martin Gerhardy f101941710 NETWORKING: fixed mixed malloc/delete/delete[]
==84284== Mismatched free() / delete / delete []
==84284==    at 0x484371B: operator delete(void*) (vg_replace_malloc.c:923)
==84284==    by 0x5BFBBF: Networking::CurlRequest::~CurlRequest() (curlrequest.cpp:38)
==84284==    by 0x5C0963: Networking::CurlJsonRequest::~CurlJsonRequest() (curljsonrequest.cpp:40)
==84284==    by 0x5ACF0B: Cloud::GoogleDrive::GoogleDriveTokenRefresher::~GoogleDriveTokenRefresher() (googledrivetokenrefresher.cpp:37)
==84284==    by 0x5ACF27: Cloud::GoogleDrive::GoogleDriveTokenRefresher::~GoogleDriveTokenRefresher() (googledrivetokenrefresher.cpp:37)
==84284==    by 0x5BC2FC: Networking::ConnectionManager::interateRequests() (connectionmanager.cpp:189)
==84284==    by 0x5BC0FA: Networking::ConnectionManager::handle() (connectionmanager.cpp:158)
==84284==    by 0x5BBF45: Networking::connectionsThread(void*) (connectionmanager.cpp:127)
==84284==    by 0x5E6932: DefaultTimerManager::handler() (default-timer.cpp:110)
==84284==    by 0x5D7F04: timer_handler(unsigned int, void*) (sdl-timer.cpp:32)
==84284==    by 0x49283D3: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.2600.1)
==84284==    by 0x4927F64: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.2600.1)
2023-01-17 23:17:17 +01:00
Eugene Sandulenko 40c93bde64 BACKENDS: NETWORKING: Slightly speed up downloads 2023-01-08 16:32:25 +01:00
Orgad Shaneh f937755c6c BACKENDS: Disable curl deprecation warnings
We still need to support older versions, so mute the warnings as long as
the old APIs can still be used.
2022-12-25 10:32:44 +02:00
Cameron Cawley 28d7b361ea COMMON: Move more file format code into common/formats 2022-12-11 22:33:23 +01:00
Eugene Sandulenko a670a17480 NETWORKING: Properly process TLS errors.
Now, when HTTPS is not supported, we will indicate it to the user.
2022-10-10 22:37:22 +02:00
Donovan Watteau 5b1ec56f96 JANITORIAL: Fix some lost or outdated URLs in comments 2022-05-19 07:57:31 +03:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko 92ec44b6ab BACKENDS: NETWORKING: Preparations for aborting the request
Looks like we need API for removing DumpFile, but that must be done
in a safe way.
2021-11-20 00:55:44 +01:00
Eugene Sandulenko 1507559a66 BACKENDS: NETWORKING: Fix local file downloading when stream is reused 2021-11-18 22:38:44 +01:00
Eugene Sandulenko 5df691a3a6 BACKENDS: NETWORKING: Properly signal end of downloaded file 2021-11-18 22:38:43 +01:00
Eugene Sandulenko db7cec6935 CLOUD: SessionRequest now can save downloaded files to disk 2021-11-18 22:38:43 +01:00
Eugene Sandulenko 768cac42f9 BACKENDS: NETWORKING: Make SessionRequest correctly process HTTP error codes 2021-11-18 22:38:42 +01:00
Eugene Sandulenko a89cb7f85e BACKENDS: NETWORKING: Added binary mode to SessionRequest 2021-11-18 22:38:42 +01:00
Orgad Shaneh 44219dfa1a BACKENDS: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
rsn8887 68fad60eb6 PSP2: Fix cloud integration 2020-04-27 23:02:18 -05:00
Eugene Sandulenko 1584c36410 NETWORKING: Fix compilation for lower versions of libcurl 2019-11-05 21:42:53 +01:00
Alexander Tkachev 99e21f4320 NETWORKING: Enter Session
Session allows to reuse SessionRequests to the same host by making them
keeping alive connection. Turns out, though, that libcurl already does
that for us, and we didn't gain any speedup we thought we'd get.

Usage:
```
Networking::Session s;
Networking::SessionRequest *request = s.get(url);
request->startAndWait();
warning("HTTP GET: %s", request->text());
s.close();
```

You can still use SessionRequest without Session (but you can't put them
on stack!):
```
Networking::SessionRequest *request = new
Networking::SessionRequest(url);
request->startAndWait();
warning("HTTP GET: %s", request->text());
request->close();
```
2019-11-05 01:47:00 +01:00
Alexander Tkachev f7d9156967 NETWORKING: Enter SessionRequest
It is to be used in a Session, though it might be used separately. It
must implement keep-alive, but it does not yet.

You must not put it to ConnMan by yourself (instead, use start()) and
you must call close() after you've finished using this request.

You can either work with it in callback, or wait() and simply use its
methods (check it's success() and then, for example, use text()). Like
this:
```
Networking::SessionRequest *rq = new Networking::SessionRequest(url);
rq->startAndWait();
if (rq->success())
warning("HTTP GET: %s", rq->text());
rq->close();
```
2019-11-05 01:47:00 +01:00
Alexander Tkachev bc63abd3e1 NETWORKING: Add CurlRequest::wait() 2019-11-05 01:47:00 +01:00
Alexander Tkachev 2acb8e2215 JANITORIAL: Fix Networking::DataResponse typedef naming 2019-11-05 01:47:00 +01:00
Bastien Bouclet 6fa7322a6a NETWORKING: Try loading the CA bundle from DATA_PATH 2019-11-03 19:48:34 +02:00