Commit Graph
17 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 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
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
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
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 a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03: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