Files
PS5_RetroArch/tests/webui_link_test.cpp
Mihawk d2d85c535c WebUI: its own daemon, up across every frontend; downloads read in blocks
The WebUI only ran inside RetroArch: a frontend change (LoadExec) ended it with
every upload in flight. It is now a payload of its own (daemon/webui_daemon.cpp,
webui/ps5-retroarch-webui.elf) serving the title's folder on 6769. eboot.bin, the
picker and ES-DE each keep a link to it (src/webui_link.h, 127.0.0.1:6770) and the
first to find none starts it through the ELF loader (9021) or websrv (8080 /hbldr).
It stops 20 s after the title closes, never mid-transfer; an update's Install
closes the title and the daemon installs. With no loader, eboot.bin serves the
WebUI while RetroArch runs, as before. The page names the frontend shown.

Downloads were handed to MHD as a descriptor (sendfile), which stopped at 33,300
bytes on the console; they are read in 256 KiB blocks.

Evidence: evidence/webui-daemon (base PS5 13.40). 200 MiB upload across picker ->
RetroArch -> picker and 60 MiB across picker -> ES-DE: one token throughout, 201
Created, every 256 KiB block equal on the console; daemon stopped 20 s after the
title closed; a 1,917,648,896-byte download's sha256 equals the FTP copy.
Command: tools/run-title.sh --picker-test=600:retroarch --retroarch-frames=1800
--watch 110 with build/tmp/webui-handover.py; tools/verify.sh: all five PASS.
Host tests: tests/test_webui_link.py, tests/test_webui_daemon.py.
2026-10-07 07:41:51 -04:00

28 lines
982 B
C++

/* The WebUI link (src/webui_link.cpp) on the host, against the loader and daemon
* tests/test_webui_link.py plays: PS5_WEBUI_APP0 and the two ports are the test's.
* It links as eboot.bin does ("title"), says it runs RetroArch once linked, and
* reports whether a daemon serves and whether it was asked to close for an update. */
#include "../src/webui_link.cpp"
#include <atomic>
#include <cstdio>
namespace
{
std::atomic<int> installs{0};
}
int main()
{
std::setvbuf(stdout, nullptr, _IOLBF, 0);
ps5_webui_link_start(
"title", [] { ++installs; }, [](const char *line) { std::printf("log %s\n", line); });
const int linked = ps5_webui_link_wait(15000);
std::printf("wait=%d\n", linked);
ps5_webui_link_frontend("retroarch");
for (int i = 0; linked && i < 500 && !ps5_webui_link_install_requested(); ++i)
usleep(10000);
std::printf("install=%d callbacks=%d\n", ps5_webui_link_install_requested(), installs.load());
return 0;
}