mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-23 00:36:42 -10:00
codex/android-native-streaming
19
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
697d251723 |
task_http: downloads to a file with request headers, and their error text
task_push_http_download_file_with_headers is task_push_http_download_file with extra request headers, for a server that wants authorization; task_push_http_download_file is now that with none. The Emscripten backend has both. A download to a file that ends in an HTTP error response used to hand its callback no body, so a caller could not log the server's message. It now hands it the start of the body, up to 4 KB, read back from the file before the file is removed; only on that error path. A successful download still hands its callback no body, and the callers that stream already go by their streamed flag and the error before they look at it. |
||
|
|
a3cf738010 |
task_http: a GET retried from its own callback is not its duplicate
A finished task stays in the queue until its callback has run, and the duplicate-download guard found it there: the same URL pushed from the failed transfer's callback was refused as already in flight. The achievement badge downloader retries that way after a network error, so every retry was dropped, the badge's callback data leaked and the badge queue stalled. A finished transfer is no longer in flight, and the guard passes it over now, in task_http.c and task_http_emscripten.c alike. http_transport_failure_test gains a lane that fails a GET and pushes the same URL from its callback: the retry must be taken and reach its own callback. It fails on the old code. |
||
|
|
2211bb3fd4 |
task_http_emscripten: park while the fetch is in flight
The handler parks until the fetch settles; the settle publishes the response through an atomic and wakes the task by ident. http_emscripten_park_test builds the unit natively against stand-in Emscripten headers, plays the browser, and checks the task waits parked and retires at the settle. |
||
|
|
f539ccd3d6 |
task_queue: flags and progress are atomics, off property_lock
task_get_flags(), task_set_flags(), task_get_progress() and task_set_progress() each took the process-wide property_lock, so every handler polling for cancellation and every progress update queued behind every other task's, and behind the progress report formatting a title under the same lock. The queue itself took it again to cancel, to settle a task and to test for a main-thread or detachable one. retro_task_t::flags and ::progress are retro_atomic_int_t now. Reads are an acquire load, progress a release store, and flag updates an atomic fetch-or / fetch-and, so concurrent updates of different bits cannot lose one another. Only a backend whose read-modify-write is not atomic (RETRO_ATOMIC_LOCK_FREE undefined) still takes property_lock, and only around the flag update. Title and error stay under property_lock: their buffers are freed and replaced, which an atomic pointer would not make safe. The snapshot and the progress report read the flags before the strings, so a task seen finished is seen with the error it set before finishing. Code that touched the two fields on a task already pushed goes through the accessors: the progress callbacks, the cloud sync handler, the emscripten HTTP handler and the cheevos badge tasks. Setting them on a task not yet pushed is unchanged. task_queue_snapshot_test covers both properties: bits flipped from two threads with a third held, and a finished task always snapshotting with its error. retro_task_threaded_gather drops from 8 lock acquisitions to 6 and the budget reference moves with it. |
||
|
|
beef1f13b9 |
net_http: share the header-text compactor; test the real one
The Emscripten backend gets response headers from the browser as one text blob and turns it into net_http's header block itself. Its test could not build task_http_emscripten.c (emcc only), so it carried a copy of the parser - and the copy had already drifted: it still split into a string_list, while the backend had moved to the block. The conversion is now net_http_headers_compact() in net_http.c: header text in, the block net_http_headers_take() returns out, in place, with CR and trailing spaces trimmed, blank lines dropped and the final line kept without its newline. The Emscripten backend calls it on the buffer the browser filled; http_emscripten_headers_test links net_http.c and calls it too, so the response side has no copy left to drift. The request side stays a copy, being static to the emcc-only file, as the test's header says. http_emscripten_headers_test: the same response cases (splitting, blank and final lines, lower-cased names, NULL and empty input) against the real function, under ASan and UBSan. |
||
|
|
dba5458fb5 |
net_http: keep response headers in one block instead of a string_list
Every transfer allocated a string_list for its response headers: the
struct, a 32-slot array, and a strdup per header line, then freed all
of it when the task finished - on the task thread, or on the video
thread in an unthreaded build. A typical response has 10 to 20 lines;
a 64-line one cost 67 allocations before a byte of body arrived.
The headers now go into one block as they are parsed: each line
NUL-terminated, an empty line at the end, grown by doubling from 1 KiB
and bounded by the existing 64 KiB header cap. It is allocated with
the first header line (a failed connect allocates nothing) and handed
over whole. In the harness, 64 header lines cost one allocation more
than one line does. The Location offset replaces the pointer into the
list, since the block may move as it grows.
API:
net_http_headers_take() the block, ownership to the caller (free());
same NULL rules as net_http_headers_ex()
net_http_header_next() walk the lines
net_http_header_value() first field by name, case-insensitive
net_http_body_is_framed() takes the block
net_http_headers() / net_http_headers_ex() remain for code outside
RetroArch, building a string_list from the block on demand; nothing
in-tree calls them.
http_transfer_data_t.headers is the block. task_http hands it over
and frees it; task_core_updater frees it; the emscripten backend
compacts the browser's header text into the same layout in the buffer
it already had, so it also drops to one allocation. WebDAV, S3 and
Google Drive walk it with net_http_header_next(), and S3's ETag lookup
uses net_http_header_value(). The WebDAV, S3, transport-failure and
cheevos harnesses build or take blocks; the S3 harness links net_http.c
for the helpers.
|
||
|
|
8e4598b6e6 |
tasks/task_http: remove task_push_webdav_put
Uploads go through task_push_webdav_put_stream, and nothing calls the buffered PUT any more, on either the native or the emscripten backend. |
||
|
|
67e3aef27d |
webdav: back up the server's copy before an upload replaces it
With destructive sync off, a WebDAV delete moves the server's file into deleted/, but an upload overwrote it in place: the setting protected against the server's copy being removed and not against it being replaced, which is the more likely way to lose a save (an older or broken save from another device overwriting a good one). The code carried a TODO/FIXME for exactly this. The local side already keeps cloud_backups/ before a fetch replaces a local file. An upload now copies the server's file to deleted/<path>-<yymmdd- hhmmss>, the name a delete uses, before the PUT. COPY rather than MOVE, so the server keeps its file until the PUT replaces it, and an upload that fails after the backup leaves the server as it was. A 404 means there is nothing to back up yet; any other failure stops the upload rather than overwrite without a backup. The COPY and the PUT each get their own Digest retry. The server manifest is rewritten every sync and is not backed up; its name moves to cloud_sync_driver.h as CLOUD_SYNC_SERVER_MANIFEST so the driver can recognise it. Adds task_push_webdav_copy() beside task_push_webdav_move() in both HTTP backends, sharing the Destination-header code. samples/network/webdav_backup includes webdav.c and plays the server request by request: backup before PUT, into deleted/ named as a delete names it, 404 not an error, a failed backup stopping the upload with one failure report, destructive sync and the manifest not backed up, and a Digest retry each for COPY and PUT. Against the old driver 5 checks fail. Runs in CI Linux samples/network under ASan+UBSan and TSan; the other WebDAV harnesses gain the new stub. |
||
|
|
b9be38fd55 |
strl: copy string literals without scanning them at runtime
strlcpy() begins with strlen() of its source. It lives in another translation unit, so with no LTO that scan happens at runtime even when the source is a literal whose length the compiler already measured, and the call itself cannot be folded away either. strlcpy_lit() passes the length over as sizeof(). When the destination size is also a constant -- sizeof(buf), the usual case -- nothing is left but the stores memcpy() compiles to: strlcpy "core_options" sizeof(buf) 7.01 ns strlcpy_lit "core_options" sizeof(buf) 0.42 ns strlcpy 41-char literal sizeof(buf) 7.74 ns strlcpy_lit 41-char literal sizeof(buf) 0.71 ns strlcpy "core_options" runtime len 7.11 ns strlcpy_lit "core_options" runtime len 0.70 ns The destination bound is kept. When the literal does not fit it defers to strlcpy(), so the copy truncates as before rather than overrunning; a form that took only the literal would have turned every one of these sites into an overflow waiting for a small buffer. The literal is concatenated with "" so a non-literal source is a compile error rather than a sizeof() that silently measures a pointer. 818 sites across 104 files were converted by parsing arguments rather than by pattern-matching text: only a three-argument call whose second argument is a bare string literal is rewritten, so a macro that happens to expand to a literal is left alone. Line endings are preserved, so the CRLF files carry only their own changed lines. test/compat/test_strl.c compares the two against each other over every destination size from 0 past the literal's length, for literals that are empty, single-character, path-shaped, adjacently concatenated and escape-bearing, checking the return, the terminator and the whole buffer so an overrun past the terminator is caught. ASan+UBSan+LSan and TSan both 4/4. The full menu_displaylist_build_list walk over every displaylist type is byte-identical to before the change (md5 a2a081bcac09cdc8d72d67efd14ac40e). |
||
|
|
c464c6620a |
Emscripten libretro-common fixes, use __EMSCRIPTEN__ (#19297)
* Emscripten libretro-common fixes
* memmap: gate the reserve/commit path off for emscripten instead of dropping mman
Emscripten was added to the "No mman available" platform list in
memmap.h, which reaches further than intended. That branch does not
just disable things: it makes memmap.c define mmap(), munmap() and
mprotect() as global symbols with malloc/free semantics on a platform
whose libc already provides working ones, and it declares mmap() with
a size_t offset where <sys/mman.h> uses off_t, so any translation unit
that pulls in both headers gets conflicting declarations. The shim's
mmap() also ignores fildes and offset, so a file-backed request would
return uninitialised memory; that is invisible today only because
Makefile.emscripten never sets HAVE_MMAP and the mapping path in
vfs_implementation.c is therefore compiled out.
What is actually unusable on emscripten is the reserve/commit model,
and that is unusable by construction rather than by omission: a wasm
linear memory grows monotonically, is committed in full, and has no
unmap, no shrink and no page protection. An anonymous PROT_NONE
mapping is a memalign of the whole length followed by a memset over
it, so memreserve() commits and touches every byte the reservation
existed to avoid, mprotect() and madvise() cannot make commit or
decommit mean anything, and munmap() only accepts an exact length
match, so the range cannot be released. Opening large content through
data_transfer would allocate the whole file up front and never give it
back.
Leave memmap.h alone and gate MEMMAP_HAVE_RESERVE instead, so
mempagesize() reports 0, memreserve() returns NULL and callers take
the bounded-allocation fallback they already have for platforms
without virtual memory. memsync() is excluded from the msync() branch
for the same reason: emscripten's msync() only accepts the exact base
of a live mapping and returns -EINVAL for an arbitrary range, while a
wasm linear memory has no separate instruction cache to flush, so the
fallthrough's 0 is both correct and the only honest answer.
mmap(), munmap(), mprotect() and memprotect() keep working through
libc as before.
* memmap: round memrelease() to the page size memreserve() rounded to
memreserve() rounds the requested length up to a whole number of pages
and maps that, but memrelease() passed the caller's unrounded length
straight to munmap(). Linux rounds the length up internally so the
mismatch is invisible there, which is how it survived; an
implementation that takes the length literally and declines a partial
unmap fails the call outright and leaks the entire reservation
whenever the length was not already page-aligned.
Apply the same rounding on the way out. mempagesize() is non-zero
wherever this branch compiles - MEMMAP_HAVE_RESERVE is only defined
when _SC_PAGESIZE is available - but the guard costs nothing and keeps
the expression from dividing the range by zero if that ever changes.
* Revert "memmap: gate the reserve/commit path off for emscripten instead of dropping mman"
This reverts commit
|
||
|
|
7890b0aa87 |
task_http: keep task->state alive until the queue retires the task
Fixes a SIGSEGV inside task_http_finder(), reported on Windows:
#0 strcmp ()
#1 task_http_finder ()
#2 retro_task_threaded_find ()
#3 task_push_http_transfer_generic_titled ()
#4 task_push_http_download_file ()
#5 download_pl_thumbnail ()
task_http_transfer_handler() freed its http_handle_t as soon as it set
RETRO_TASK_FLG_FINISHED. But a task stays *findable* long after its
handler is done: retro_task_threaded_find() scans the running,
finished and retiring lists, and task_http_finder() dereferences
task->state on every candidate it is handed. task->state therefore
dangled for the entire window between the last handler tick and full
retirement, and any push racing a finishing download read freed
memory.
This is not new. It survived because connection_url was an inline
char[NAME_MAX_LENGTH]: reading a freed-but-still-mapped array yields
stale bytes and strcmp() plods through them harmlessly. Making
connection_url a pointer -- so that long URLs stopped defeating the
duplicate-download guard -- turned the same read into "load the freed
chunk's tombstone and dereference it". The pointer change did not
introduce the defect, it removed the padding that was hiding it, and
the thumbnail downloader moving to task_push_http_download_file() put
far more pushes alongside far more retirements.
The handle is now released in task_http_transfer_cleanup(), which the
queue calls during retirement, with task->state cleared first. Same
change in the emscripten backend, which had the identical shape.
Also closes the narrow window underneath it in task_queue.c.
retro_task_internal_retire_body() ran the callback and cleanup with
neither lock held while the task was still in tasks_retiring, which
find() scans. cleanup() is where a task releases task->state, so that
raced any concurrent find(). Retirement is split: the callback still
runs while the task is findable, since it may push follow-up tasks and
so cannot hold finished_lock, but cleanup now runs only after the task
has been pruned from the retiring list and is unreachable.
Separately,
|
||
|
|
56d5967020 |
net_http: own the dedup key, add explicit init/deinit, stream core downloads to disk
Three loose ends from the HTTP task audit.
1. The duplicate-download guard silently stopped guarding.
Both backends stored the request URL in
char connection_url[NAME_MAX_LENGTH] via strlcpy, but
task_http_finder() compares that stored copy against the raw candidate
URL. Truncation on the stored side alone means that once a URL
reaches NAME_MAX_LENGTH -- 256, or 128 on the small-path platforms --
the two can never compare equal, so the check whose comment reads
"Concurrent download of the same file is not allowed" returned false
for every candidate.
The failure is one-directional and therefore silent: truncation cannot
conflate two distinct URLs, since the candidate is never truncated to
match, so nothing broke loudly and downloads just stopped being
deduplicated. Playlist thumbnail URLs exceed the buffer routinely,
concatenating a long CDN base path with a percent-encoded game title.
The cost is not just bandwidth: both tasks reach their completion
callback, and cb_http_task_download_pl_thumbnail() ends in
filestream_write_file() on an identical path. Two writers, one file.
connection_url is now a heap-owned copy of the full URL in both
backends. NULL means "no key" and matches nothing, so an allocation
failure admits a redundant download rather than dropping one -- the
safe direction, since a dropped push strands the caller's completion
callback forever. samples/tasks/http/http_url_dedup_test.c, which
landed red documenting this, now passes at both NAME_MAX_LENGTH
values; it keeps the old fixed-buffer shape as a second oracle so a
revert is caught.
Two small ones alongside it, both in task_http.c:
cb_http_conn_default() returned -1 on network_init() failure without
setting http->error, and the caller discards the return value -- so
the task advanced with a NULL handle, net_http_update(NULL, ...)
returned true immediately, and it finished with neither data nor an
error, which callers read as a clean success with task_data == NULL.
And HTTP_STATUS_TRANSFER_PARSE / _PARSE_FREE were never set by
anything, so the enumerators and the case handling one of them were
dead.
2. net_http_init() / net_http_deinit().
The locks guarding the DNS cache and connection pool were created
lazily on first use:
if (!dns_cache_lock) dns_cache_lock = slock_new();
which is an unsynchronised first-use initialisation of the very lock
meant to serialise that cache. Two threads arriving together each
create one, one store wins, and the loser goes on locking an object
nobody else holds. It does not reproduce once the locks exist, which
is why a TSan run over concurrent transfers came back clean -- the
window is only ever the first two requests of the process.
There was also no teardown at all: pooled sockets and their SSL
contexts, cached addrinfo, the strdup'd domains and both mutexes lived
until the process exited. LeakSan could not see any of it, since the
lists hang off file-scope globals and so count as still reachable.
net_http_init() is called from retroarch.c immediately before
task_queue_init(), which is what spawns the task thread;
net_http_deinit() after task_queue_deinit(), so no transfer can still
hold a pooled connection. deinit detaches both lists under their lock
and drains them with it released -- net_http_resolve() takes the same
lock at the end of its run, so joining a resolver thread while holding
it would deadlock.
3. Core downloads stream to disk.
cb_http_task_core_updater_download() buffered the whole core in RAM
and wrote it in one go, which is what task_push_http_download_file()
was added to avoid. Everything that gated the write --
path_mkdir() and the "decompression already in progress" check -- now
runs before the transfer starts rather than after it, which is the
reordering that made this worth doing separately. The
already-decompressing check matters more in the new position, not
less: it now prevents overwriting a file another task is reading,
where before it merely declined to.
The callback keeps the output_dir computation for the decompress call
and gates on data->status, since the partial file is removed unless
the transfer finished cleanly with a 2xx.
Sample suite extended to 92 checks, including a teardown case that
deinits, re-inits and transfers again -- calling deinit is what makes
any real leak in the cache and pool visible to LeakSan. Clean under
ASan, LSan, UBSan and TSan. net_http.c, task_http.c and
task_core_updater.c compile clean; task_http_emscripten.c verified
with emcc 6.0.5 at -Wall; retroarch.c hunks are the two
net_http_init/deinit calls and one include.
|
||
|
|
1787d2253a |
net_http: add a streaming body sink, and a task entry point that downloads straight to disk
Responses were accumulated whole in RAM and only then written out, so a core download held its entire payload -- up to the 256 MiB NET_HTTP_MAX_CONTENT_LENGTH ceiling -- as anonymous memory for the life of the transfer, and then copied all of it a second time through filestream_write_file(). Worse, T_LEN sized the receive buffer to Content-Length the moment the headers parsed, so a server's advertised length alone drove the allocation before a single body byte arrived. net_http_connection_set_sink() attaches a callback that receives each run of decoded body bytes as it arrives. With a sink set the buffer stays at the receive window, the Content-Length preallocation is skipped, and net_http_data() returns NULL/0 since the handle retains nothing; status and headers are unaffected. A sink returning false aborts the transfer like any transport failure, which is how a full disk surfaces instead of a silently truncated file. Measured with the sample harness on a 4 MiB body: the buffered path peaks at 4128812 bytes of receive window, the streamed path stays under 1 MiB regardless of payload size. Flushing is per body type, since pos/len mean different things in each. T_LEN decrements len by what it hands off so the existing "pos == len" completion test keeps working untouched, with the advertised total moved to a new content_len field for progress reporting. T_FULL flushes and resets both. T_CHUNK flushes at three points -- mid-chunk carry-over, chunk straddling the receive window, and end of parse pass -- sliding the unconsumed raw tail to the front each time so the decoder's invariant (len is the decoded offset of the current chunklen line) still holds at zero. Progress now reports flushed + pos rather than pos alone. None of the flush paths run without a sink, so the default behaviour is byte-for-byte what it was. task_push_http_download_file() is the task-layer entry point: it opens the destination before the transfer starts, so a bad path fails the push rather than surfacing megabytes later, and removes the partial file unless the transfer finished cleanly with a 2xx -- a leftover partial would otherwise be indistinguishable from a good core on the next run. The completion callback gets status and headers with data == NULL. The emscripten backend implements the same entry point by writing through in its settle callback. The browser buffers the whole response either way, so it is not a memory win there; it exists so both backends honour one contract. Sample coverage extended to 91 checks: body reconstructed byte-for-byte through the sink across all three framings, at chunk sizes down to 1 and with the server dribbling bytes so every boundary is torn; the handle retaining nothing; a sink write failure aborting rather than truncating; and a peak-window ceiling. That ceiling is paired with a contrast case asserting the *buffered* path exceeds it, so the test cannot quietly pass by both paths happening to stay small on a given host. Clean under ASan, LSan, UBSan and TSan. Not migrated here: cb_http_task_core_updater_download() still buffers. It calls path_mkdir() and the "decompression already in progress" check after the download completes, both of which have to move ahead of the transfer before it can stream, and that reordering wants testing against a real build rather than the loopback harness. |
||
|
|
51c3c8dca0 |
task_http_emscripten: move to emscripten_fetch, restoring headers, binary bodies and response status
The emscripten backend sat on emscripten_async_wget2_data(), and that API is the root cause of how far this file had drifted from tasks/task_http.c. It takes the request body as a single NUL-terminated `const char*` and offers nothing for request headers, a user agent, or reading response headers back, so everything the native path provides beyond "GET a URL into memory" was silently dropped or stubbed out. emscripten_fetch() covers all of it; switching over closes six defects at once. - Request headers were accepted and discarded on every entry point. task_push_http_transfer_with_headers() sent none, which meant no Authorization header, so cloud sync could not authenticate at all. All five webdav helpers logged "Response headers not supported, webdav won't work" and then did exactly that. RetroArch passes headers as a raw CRLF blob and fetch wants a NULL-terminated key/value array, so http_req_headers_parse() converts between them. - task_push_webdav_put() passed put_data as a NUL-terminated string and dropped the `len` argument entirely, truncating any binary payload at its first zero byte. Length now travels explicitly. - Response headers are recovered via emscripten_fetch_get_response_headers() and split into the same string_list of "Name: Value" lines net_http.c produces. - resp->status was hardcoded to 200, and the error callback recorded no status at all, so callers branching on data->status -- webdav's 401 digest challenge, the thumbnail downloader's 404 check -- saw a NULL task_data and could not distinguish "not found" from "the network died". Both paths now settle with the real status, and error bodies are kept since 4xx/5xx routinely carry one. - wget_onload_cb() returned early when its malloc failed, leaking the whole response buffer. The fetch is now closed unconditionally. - Cancelling a task never aborted the transfer. http_handle_free() closes the fetch, which emscripten guarantees suppresses any further callback. Two lifetime fixes carried over from task_http.c: task_push_http_transfer_file() assigned t->title after task_queue_push(), the exact use-after-free already fixed and commented in the native file -- harmless single-threaded, a genuine race under -pthread/PROXY_TO_PTHREAD. And emscripten_fetch does not copy requestData or requestHeaders, so http_handle now owns both for the fetch's lifetime rather than retaining a caller's buffer. Also drops the local http_transfer_progress_cb(), which called video_display_server_set_window_progress() unconditionally while its header was behind #ifdef RARCH_INTERNAL, in favour of the shared task_window_progress_cb() the native path uses; and sets RETRO_TASK_FLG_ALTERNATIVE_LOOK, which was missing here. network/cloud_sync/webdav.c matches the digest challenge case-insensitively now. Browsers lower-case response header names, so "WWW-Authenticate: Digest " never matched on this backend. Header names are case-insensitive per RFC 9110 5.1, so the consumer was what needed fixing; webdav_create_digest_auth() skips a fixed byte count past the prefix, so the offset is unaffected. Makefile.emscripten passes -sFETCH=1, which the fetch API requires. Adds samples/tasks/http/http_emscripten_headers_test.c covering both conversions against hand-built blobs of the kind task_push_webdav_move() and task_push_http_transfer_with_content() produce: bare LF, missing trailing CRLF, empty values, embedded colons, malformed lines, and growth past the initial array capacity. A header dropped here is an auth failure rather than a crash, so the degenerate cases are worth pinning. 33 checks, clean under ASan and UBSan. Verified with emcc 6.0.5: the file compiles clean at -Wall and -sFETCH=1 links. |
||
|
|
e4462428e4 |
short-chain strlcpy bound fixes via strlcpy_append
Apply strlcpy_append (commit |
||
|
|
9708810444 | More string_is_empty removal | ||
|
|
cc826c4ca6 | Cleanup some variable names and some other cleanups | ||
|
|
b2ca569521 | Logging unification cleanups | ||
|
|
56014a27d6 |
Enable pthreads on Emscripten (#17586)
* workerized RA * Workerized (non-async) web player, using OPFS This patch eliminates the need for asyncify and uses modern filesystem APIs instead of the deprecated, unmaintained BrowserFS. This is a WIP patch because it won't fully work until these two Emscripten PRs land and are released: https://github.com/emscripten-core/emscripten/pull/23518 https://github.com/emscripten-core/emscripten/pull/23021 The former fixes an offscreen canvas context recreation bug, and the latter adds an equivalent to BrowserFS's XHR filesystem (but without the hazardous running-XHR-on-the-main-thread problem). The biggest issue is that local storage of users who were using the old version of the webplayer will be gone when they switch to the new webplayer. I don't have a good story for converting the old BrowserFS IDBFS contents into the new OPFS filesystem (the move is worth doing because OPFS supports seeking and reading only bits of a file, and because BrowserFS is dead). I've kept around the old libretro webplayer under pkg/emscripten/libretro-classic, and with these make flags you can build a non-workerized RA that uses asyncify to sleep as before: make -f Makefile.emscripten libretro=$CORE HAVE_WORKER=0 HAVE_WASMFS=0 PTHREAD=0 HAVE_AL=1 I also moved the default directory for core content on emscripten to not be a subdirectory of the local filesystem mount, because it's confusing to have a subdirectory that's lazily fetched and not mirrored to the local storage. I think it won't impact existing users of the classic web player because they already have a retroarch.cfg in place. * Get fetchfs working without manifest support * makefile fixes * fix scaling, remove zip dependency * Support asset/cheats/etc downloaders for emscripten - Add http transfer support for emscripten - At the task_http level, not the net_http level --- so no netplay or webdav. - Change default paths to be more like other platforms - Gives us smaller bundles and a faster boot time - Had to work around a task queue bug on Emscripten - I made the smallest possible change to do it, but it may be better to fix in rthread.c * Load an emscripten file_packager package on first run If no ozone assets are present, load a libretro_minimal package created using Emscripten's built-in file packager. * updated readme, removed indexer from wasmfs libretro-web * Put back zip dependency, load asset bundle into opfs on first run * fix upload path * Remove unused function * easy testing setup for two multithreaded conditions 1. make PROXY_TO_PTHREAD=1 (slower) 2. make PROXY_TO_PTHREAD=0 (bad audio, because doesn't sleep in openal.c) * Remove condition on sleep in openal also make input_driver check existence of drv->axis, drv->button before calling them. * Fix resizing under EGL * Don't force config file path on emscripten * Add time.h include to netplay, default HAVE_NETPLAYDISCOVERY to 0 * Remove nearly all proxied joypad calls under emscripten * Fix file uploads under firefox * Fix safari API uses, but Safari still hangs in OPFS filesystem mount I think this can be fixed by moving the backend creation off the main thread. * Move filesystem init into emscripten C entry point * Setup filesystems off of main thread * re-set default player to async Also improve Safari compatibility under proxy-to-pthread condition * Safari upload file fixes * Remove some excess prints * Fix typo |