Commit Graph

18 Commits

Author SHA1 Message Date
87ad0f13af viewer: --port accepts only plain ASCII decimal digits
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 20:50:45 +01:00
57c175391d Revert #2490: its console-ABI list proxy breaks run_tiny_frame (please rebase and split)
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:42:53 -05:00
8d88450ee2 Merge pull request #3960 from Wasler
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:56 -05:00
fa5f26db8e Merge origin/main: DXGI device fields coexist with the console-ABI device state 2026-11-22 20:39:59 -07:00
425059bd6f tests: restore the viewer serve coverage the rebase dropped
The oc-agent viewer-tests commit did not survive the rebase onto
upstream. Ported onto the current file (raw_request's extra_headers
parameter): index.html at /, 404 and no-store on missing files, 501 for
non-GET/HEAD, HEAD/GET header parity, directory listing refusal, encoded
separators, Range ignored for whole-chunk downloads, whole-body
streaming past one copy block, parallel downloads not interleaving, and
the no-world handler serving only its own folder.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 17:02:10 -07:00
b23779d6a9 tests: pass errors=replace to subprocess pipes capturing python -I tools 2026-11-23 00:42:37 +02:00
0763843dac Merge pull request #3502 from shdann 2026-11-22 17:02:22 -05:00
ca79926396 Merge pull request #3395 from kotorvr 2026-11-22 17:01:51 -05:00
ace286f6d7 tests: the restart test asserts the server thread stopped after shutdown
A join with a timeout returns either way, so a stalled shutdown would have
passed and left the thread running (review of #3502).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 00:09:24 +03:00
f0bdc5789b viewer: a second viewer on a port a running one serves is refused on Windows too
HTTPServer sets SO_REUSEADDR. On Windows that lets a second socket bind a
port that is already being listened on, so a second `serve.py --port N`
printed its URL and then received no requests while the first viewer kept
answering. ViewerServer leaves the option off on Windows, where a restart
needs none, and keeps it elsewhere; the second viewer now stops with the
existing "can't listen on port" line.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 23:43:11 +03:00
a45ec655f6 viewer: serve only the page outside /world/
serve.py put its device-name, alternate-data-stream and trailing-dot
guards in front of /world/ only; every other path went straight to
SimpleHTTPRequestHandler. On Windows GET /NUL opened the device (200,
empty) and /index.html::$DATA, /index.html. and /index.html%20 were
served. The viewer folder holds one page, so outside /world/ the server
now answers "/" and "/index.html" and nothing else (404), matched
before any decoding. Without --world, /world/ is 404 as well instead of
falling through to a world folder that happens to sit beside the page.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:21:49 +00:00
07087692bf viewer: a Ctrl+C right after the serving line stops the viewer too
serve.py printed "viewer: http://..." before entering the try that catches KeyboardInterrupt.
test_ctrl_c_stops_the_viewer_without_a_traceback sends SIGINT as soon as it reads that line, and
when the signal was handled between the print and the try, the interrupt escaped: exit -2 and a
traceback. Under load that is 24 of 300 runs with 12 at once (300 of 300 clean with the print inside
the try); a parallel pytest run on main failed the test this way.

The print is inside the try now, and a new in-process test raises the interrupt from printing that
line, so the case is checked every time instead of by chance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:01:53 +00:00
f6d884b42c Merge pull request #2555 from Kosmabb8 2026-11-22 13:16:08 -05:00
c9679c00f0 viewer: reject Windows device aliases on Python 3.12 2026-11-22 18:27:32 +01:00
8c56529973 fix(viewer): reject duplicate Host headers and malformed Host values (BUILD-532)
send_head checked self.headers.get("Host"), which returns only the first
Host field, so "Host: 127.0.0.1" followed by "Host: evil.example" was
served. Requests with more than one Host field now get 400 (RFC 7230
section 5.4); a single field is checked as before, and a request without
one is still allowed for local tools.

host_allowed now rejects malformed values it used to accept: text after
an IPv6 literal's "]" other than ":port" ("[::1]junk"), a second colon,
more than one trailing dot, and ports that are not 1-5 ASCII digits up
to 65535 ("localhost:abc", "localhost:65536", full-width digits). The
length cap runs before int(), so a port of thousands of digits cannot
hit Python's int conversion limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:04:49 +01:00
342ba8cd41 Viewer: report an invalid explicit --world directory 2026-11-22 12:13:12 +01:00
867910e329 viewer: a port in use is one line, and Ctrl+C stops the server without a traceback
Starting serve.py while a viewer is still running on the port ended in an OSError traceback from socketserver, and
stopping it with Ctrl+C in a KeyboardInterrupt one. The first is now an argument error that names the port and
points at --port 0; the second prints "viewer: stopped" and closes the socket.

tests/test_viewer_serve.py: two tests, both fail on the old code. The Ctrl+C one is skipped on Windows and gives
its child the default SIGINT disposition, so it also passes under a runner that has SIGINT ignored.
2026-11-22 10:04:47 +00:00
e53ce0d54d viewer: test the serve.py guards, and make a bad --port a usage error
viewer/serve.py holds the DNS-rebinding Host check, the /world/ traversal
resolver and the 403s in front of them, and nothing tested it: the CI viewer
job runs only the streaming tests. tests/test_viewer_serve.py covers the Host
allow/deny matrix, path resolution (.., encoded %2e%2e, backslashes, NUL,
drive letters, reserved device names, directories, a symlink out of the
world) and the HTTP layer on a loopback server (200 with no-store, the .glb
MIME type, HEAD, query strings, 403 for a foreign Host and for traversal).

--port was a plain int, so 70000 or -1 reached socketserver and ended in
OverflowError; 0 bound a free port but printed the URL of port 0. It is now
an argparse type limited to 0-65535, and the message prints the bound port.

Negative control on main: the CLI test fails (exit 1 with a traceback) and
port_number does not exist. With the change: 21/21. The node viewer tests
still pass 29/29. Standard library only, temporary world folder, no game data.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 23:34:13 -06:00