Commit Graph
21 Commits
Author SHA1 Message Date
Henrik Rydgård b120f0004f http: Make Cancel() actually stop an HTTPS transfer
Cancel() worked on the plain HTTP path - cancelled_ is threaded down as
progress->cancelled and checked while connecting and reading - but on the naett
path it only set a flag that nothing looked at. The transfer ran to completion
and cancelling just relabelled the result afterwards. Cancelling a store icon
that scrolled away, or a homebrew download the user gave up on, kept using the
bandwidth either way.

naett has one hook for this: a body writer that takes less than it was given
fails the request. So HTTPSRequest installs its own writer, which refuses
everything once cancelled. That works on all four backends and needs nothing
from naettClose, which is only really safe on Android.

The catch is lifetime. The writer runs on naett's transfer thread, and a request
that's still going when we're torn down would then be writing into a destroyed
HTTPSRequest - which is why the buffer it writes into is a separate refcounted
sink rather than a member. Join() on an unfinished request parks the sink where
it won't be freed and lets the request go, so a chunk that lands afterwards
writes somewhere that still exists.

That path is shutdown-only: RequestManager only cancels from its destructor, and
Update() waits for Done() before joining. Join now also notices a request that
finished while nobody was polling, and closes it properly instead of abandoning
it. What's left leaking at that point is a request still in flight as the
process exits, which is what already happened, just deliberate now and logged as
such rather than as an error.
2026-09-05 13:15:12 -06:00
Henrik Rydgård 96ae36b7dd Fix some comments, remove redundant fields etc 2026-06-13 17:44:26 +02:00
Henrik Rydgård 433defee9a Address some more freedback in HTTPRequest 2026-06-13 15:21:05 +02:00
Henrik Rydgård e8a1638c8d Cleanup 2026-06-09 23:49:54 +02:00
Henrik Rydgård 8c8dd0f0d0 Add utility function to snoop the file cache 2026-03-09 10:40:51 +01:00
Henrik Rydgård 71d884379d Fix a potential race condition 2026-03-09 00:51:39 +01:00
Henrik Rydgård 1a95e9e4e9 Fetch the public adhoc server list from metadata.ppsspp.org/adhoc-servers.json 2026-03-06 13:25:07 +01:00
Henrik Rydgård 7fa3b48650 Add extra safeguards, fall back to cached file if download fails. 2025-01-23 13:58:59 +01:00
Henrik Rydgård 7f877bb16b Implement simple file caching. 2025-01-23 13:28:51 +01:00
Henrik Rydgård eb719c43e8 HTTP: Replace ProgressBarMode with a new RequestFlags enum 2025-01-23 12:09:56 +01:00
Henrik Rydgård 493367c89f More http code cleanup 2025-01-23 10:16:51 +01:00
Henrik Rydgård 12adad0494 HTTP request classes code cleanup - move common things up to the base class 2025-01-23 10:16:51 +01:00
Henrik Rydgård 59a56d66c7 Add a "reason" argument to sleep_ms().
sleep_ms() should generally be avoided when possible. This can be used to try
to track down unnecessary sleeps by adding some logging.

This commit on its own doesn't actually add any logging.
2024-11-21 15:28:51 +01:00
Henrik Rydgård eccd7f3767 More const/static-ification 2024-09-17 15:22:37 +02:00
Henrik Rydgård c5791764d8 Make the i18n T function use std::string_view
Buildfixes, crashfixes

One more

Android buildfix

Buildfix Qt
2024-02-12 18:44:39 +01:00
Henrik Rydgård 6d28ccbd8e Add HTTP log channel, and make ACHIEVEMENTS a proper one. 2023-08-25 13:53:46 +02:00
Henrik Rydgård 93bb113009 Common: Rename Download to Request, and the old Request to ServerRequest. 2023-07-21 22:12:00 +02:00
Henrik Rydgård 9535b16740 Use the patched naett functions to implement progress updates 2023-07-21 18:23:33 +02:00
Henrik Rydgård 61db21b12d Cleanup, fix so we can run RetroAchievements with https, and start doing that 2023-07-21 10:49:01 +02:00
Henrik Rydgård fbd980bee6 Get basic Naett requests to work (the store works in https mode) 2023-07-21 10:28:17 +02:00
Henrik Rydgård f13a07f19b Break out Download and RequestManager into its own file 2023-07-21 10:27:40 +02:00