Map downloads: one that has begun goes on when the session stops waiting

Follow-up to #225. The session still waits 30 minutes in all for a map
(checking, the two-minute question, download, install, apply, join), and
servers and lobbies still let a player go at 30 minutes. But a download
that has begun is no longer cut off at 27 minutes: a large map on a slow
connection never came at all that way.

- Once the download has begun, the session's deadline is the session's
  alone. The download goes on (up to its own four hours, as before #225),
  installs and is applied, and the player is told to join again; no
  rejoin is tried past the deadline, where the server would turn them
  away. "Map still downloading" says so when the session stops waiting.
- Before the download, the deadline still ends the check and the question.
  Declining or cancelling still stops it and removes the partial file.
- A download whose session has gone is not cancelled by joining another
  session; a new map need is turned away until it is done.
- The 27-minute transfer budget and its completion reserve are gone from
  map_fetch_policy.h, with their tests; the map download tests cover the
  new behaviour.
- The HTTPS timeout test compiles with warnings as errors (a signed and
  unsigned comparison), and get_text's stale-file removal is indented again.
- README: map downloads described as they now are.
This commit is contained in:
AyeZeeBB committed 2026-10-15 14:23:06 -05:00
1 parent e88853add8
commit 94a616feb9
8 files changed
+121 -148

No files matched your search

+1 -1
View File
@@ -197,7 +197,7 @@ std::optional<std::string> get_text(std::wstring_view url, std::uint64_t max_byt
const auto path = std::filesystem::path(length ? std::wstring(folder, length) : L".") /
(L"reskate-get-" + std::to_wstring(GetCurrentProcessId()) + L"-" + std::to_wstring(++serial) + L".tmp");
std::error_code error;
std::filesystem::remove(path, error); // discard a stale file left by an earlier process
std::filesystem::remove(path, error); // discard a stale file left by an earlier process
const auto download = get(url, path, max_bytes, timeout_seconds, agent, watch);
if (result) *result = download;
std::optional<std::string> text;