Repository navigation
h3: route addStaticHandler mounts over HTTP/3 (#60) - #65
Merged
Merged
Conversation
Wire the protocol-agnostic static FSM into the H3 dispatcher, mirroring H1/H2: a has_static_mount gate calls http_static_try_serve before the user handler. HARD_ZERO hands the request to the pump (on_armed pins the stream, on_static_done runs the dispose tail); HANDLED sets skip_handler so the coroutine entry skips the handler and dispose commits the buffered body; PASSTHROUGH falls through. Static-only deployments (mount, no addHttpHandler) now dispatch and synthesize a 404 on miss. New phpt 027: mount-routing byte integrity across the 16 KiB boundary + index + 404, static-only. Full h3 + static suites green (50/50).
Contributor
CoverageTotal lines: 80.51% → 80.71% (+0.20 pp)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes HTTP/3 static delivery (#60):
addStaticHandlermounts are now served over HTTP/3, not just explicit$res->sendFile()(#64).Wires the protocol-agnostic static FSM into the H3 dispatcher, mirroring the H1/H2 sites almost verbatim:
has_static_mountgate inhttp3_stream_dispatchcallshttp_static_try_serve(with a new file-localh3_static_dispatch_cbs) before the user handler.on_armedpins the stream + in-flight counter,on_static_donerunsh3_dispose_tail. No coroutine spawned.skip_handlermakes the coroutine entry skip the user handler; dispose commits the buffered body.addHttpHandler) now dispatch and synthesize a 404 on miss.The delivery pump (
h3_stream_send_static_response, wired inh3_stream_ops.send_static_response) and the async-refcount discipline are unchanged — reused from #64.Test
New
tests/phpt/server/h3/027-h3-static-mount.phpt: static-only mount over H3 — byte-integrity (sha1) across the 16 KiB chunk boundary (1/16383/16384/16385/50000), index resolution (200), missing (404), traversal (404).h3client: 64 KiB asset (async pump), 1 KiB (inline), 404 all correct.Closes #60.