http: HTTP/2 #72
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
HTTP/2 in
std/http, client and server. Needed by gRPC (#75), by HTTP/3's ordering (#73) and byh2in the client's ALPN offer (step 3 of #71). The messages of NETWORK.md section 6 do not change: a stream is a request and a response, HPACK and the flow-control windows are TorbScript over a connection task with a channel per stream (NETWORK.md section 12).This is an epic: it is far more than one PR. Each step is its own
readyissue, filed just in time when the one before has landed. Noreadyon the epic itself.Source
Steps
HpackEncoderandHpackDecoder#563SETTINGSand the error codes, as an encoder and decoder with no connection #685h2.trb): stream state machine, flow control (connection and stream windows),SETTINGShandshake and ack,PING,GOAWAY,RST_STREAM,CONTINUATIONsequence, the limits and the rapid-reset guard; two ends tested in one program #699Transportwith a channel per stream, theSETTINGSandPINGtimeouts, tested over loopback (filed when step 3 has landed)h2in the ALPN list ofhttps, the preface detected on cleartext, a stream is aRequestand the handler'sResponseis the stream's answerh2insupportedProtocols(completes step 3 of #71), one multiplexed connection per origin in the pool, a retry afterGOAWAYDecided by the loop
std/http(hpack.trb,h2frame.trb,h2.trb, ...), imported by relative path likeparse.trb; no new public name except what aClientand aServeralready are. HTTP/2 is a transport detail of the same API: aClientoffersh2andhttp/1.1through ALPN and uses what the server picks, aServeraccepts both. No switch to turn it on or off (no flags, nothing to migrate).Upgrade: h2cof RFC 7540 is gone from RFC 9113 and is not built. A server detects the preface onhttp(gRPC inside a cluster needs it). A client that startsh2on cleartext is an option decided with gRPC (#75), not here.SETTINGS_ENABLE_PUSH = 0, the server never pushes; RFC 9113 deprecates it), stream priorities (the deprecated tree of RFC 7540 is parsed and ignored; RFC 9218priorityis a later issue), extendedCONNECTof RFC 8441 (WebSocket over HTTP/2; the live UI's101upgrade stays onhttp/1.1, which browsers open for a WebSocket when the server does not advertise it; a handler that answersResponse.upgradeon anh2stream gets501).ChunkedReader). A public trailers API onRequestandResponseis what gRPC needs; it is its own issue, filed with #75, and not part of #72.--native, so forge CI needs no Go binary and no download. Running the real h2spec in CI is a possible later check, not a condition of this epic.net/http2:SETTINGS_MAX_CONCURRENT_STREAMS100, initial window 65535 raised byWINDOW_UPDATE,SETTINGS_MAX_FRAME_SIZE16384,SETTINGS_MAX_HEADER_LIST_SIZE64 KiB; a frame beyond what was announced is a connection error. The numbers are settled in steps 3 to 5 with tests, not asked.Acceptance criteria
std/httpDesign record / seed
Implements NETWORK.md slice 12 (HTTP/2 only; HTTP/3 is #73). Seed: no for every step planned (std only, no syntax, no native, no string lookup by the compiler); a step that needs one says so in its own issue.
Dependencies
#118 (tls: ALPN) is closed and landed; the client's pool (slice 7) and
Transportare built. Unblocks step 3 of #71, #73 and #75.Moved from the planning lists of the docs; the design record stays the specification.
[loop:torbscript] intake: in scope (author orion, label loop), sources NETWORK.md slice 12 and FIRST-PARTY.md gap 25, not a duplicate. Large (client and server, conformance suite); refine splits it. Depends on #118 (TLS ALPN). next: waiting (dependency #118) until 2026-10-10T04:00:00Z
[loop:torbscript] claim refine by session:loop-torbscript-20261029 until 2026-10-29T05:26:35Z
[loop:torbscript] decided by the loop: #72 is an epic (HPACK, frames, connection core, server, client, conformance suite), six steps ticked off in the body, only step 1 filed (just in time; keyword search for HTTP/2, h2, HPACK, Huffman found no duplicate; backlog gate off;
mainCI not red). Step 1 is HPACK as a pure codec (#563): the narrowest piece with its own test vectors (RFC 7541 Appendix C), no connection and no seed change, so it fits one PR of two commits. Design questions settled and recorded in the epic body: internal modules ofstd/http, no switch (the client offersh2andhttp/1.1through ALPN, the server accepts both); cleartext is prior knowledge only, noh2cupgrade; no server push, no priorities, no RFC 8441 (the live UI's101stays onhttp/1.1); trailers are dropped as in HTTP/1.1 today, a trailers API belongs to gRPC (#75); acceptance 2 is met by "an equivalent suite": the h2spec groups as conformance programs over our own frame codec, no Go binary in CI. Seed impact: none.[loop:torbscript] refine: epic body rewritten to the definition of ready, step 1 filed as #563 with
ready, next: waiting (step #563; steps 2 to 6 follow just in time). Tokens: ~75000[loop:torbscript] refine: step 1 landed (#563 closed, HPACK). Step 2 filed as #685 (loop, ready): the frame layer of RFC 9113 sections 4 to 6, no connection, no seed change. Steps 3 to 6 follow just in time.
next: waiting (step #685)
[loop:torbscript] claim refine by session:loop-torbscript-20261030 @anthropic:tkoehn until 2026-10-30T17:38Z
[loop:torbscript] refine: step 2 landed (#685, frames, in
f0d81eb6and264ec931). Step 3 filed as #699 (loop, ready): the connection core of RFC 9113 sections 5 and 6.9 as a sans-IO state machine (std/http/src/h2.trb: stream states, flow-control windows, SETTINGS handshake, PING, GOAWAY, RST_STREAM, CONTINUATION sequence, limits, rapid-reset guard), two ends tested in one program, no seed change. The epic's step list is refreshed: step 2 ticked, step 3 links #699, and the connection task over aTransportwith a channel per stream is now step 3b, filed just in time after #699 has landed. Steps 4 to 6 keep their numbers.next: waiting (step #699)