You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HTTP/2 fetch path added in #27362 buffers the entire response body before
returning. As a result, requests that rely on streaming response behaviour are not served over HTTP/2 — to avoid silently ignoring them, such requests
currently fall back to HTTP/1.1 (they do not advertise ALPN h2). This issue
tracks adding real streaming support so HTTP/2 reaches parity.
Affected request features (all currently force HTTP/1.1 via Request.uses_response_streaming()):
on_progress (RequestProgressFn)
on_progress_body (RequestProgressBodyFn)
stop_copying_limit
stop_receiving_limit
(on_finish already works on the HTTP/2 path.)
What's needed
Feed the per-DATA-frame body chunks from H2Conn's response read loop
(read_response in vlib/net/http/h2_conn.v) into the same callbacks, and
honor the stop limits, matching the HTTP/1.1 semantics in receive_all_data_from_cb_in_builder:
call on_progress / on_progress_body per chunk as DATA frames arrive,
stop_copying_limit: stop appending to the response body after N bytes while
still firing callbacks and reading to completion,
stop_receiving_limit: stop reading the stream early.
Likely shape: thread a generic chunk hook + the two limits through H2ClientRequest (keeping H2Conn decoupled from net.http.Request), and have
the shim (h2_do in backend.c.v) adapt the request's callbacks to it. Then
drop the uses_response_streaming() gate so these requests can negotiate h2.
Acceptance criteria
on_progress / on_progress_body fire per DATA frame on the HTTP/2 path.
stop_copying_limit / stop_receiving_limit behave as on HTTP/1.1.
Streaming requests with enable_http2: true negotiate h2 (gate removed).
Tests over the in-memory transport assert chunk-by-chunk callback delivery and
the stop-limit behaviour; a large download_file_with_progress-style case.
Summary
The HTTP/2 fetch path added in #27362 buffers the entire response body before
returning. As a result, requests that rely on streaming response behaviour are
not served over HTTP/2 — to avoid silently ignoring them, such requests
currently fall back to HTTP/1.1 (they do not advertise ALPN
h2). This issuetracks adding real streaming support so HTTP/2 reaches parity.
Affected request features (all currently force HTTP/1.1 via
Request.uses_response_streaming()):on_progress(RequestProgressFn)on_progress_body(RequestProgressBodyFn)stop_copying_limitstop_receiving_limit(
on_finishalready works on the HTTP/2 path.)What's needed
Feed the per-DATA-frame body chunks from
H2Conn's response read loop(
read_responseinvlib/net/http/h2_conn.v) into the same callbacks, andhonor the stop limits, matching the HTTP/1.1 semantics in
receive_all_data_from_cb_in_builder:on_progress/on_progress_bodyper chunk as DATA frames arrive,stop_copying_limit: stop appending to the response body after N bytes whilestill firing callbacks and reading to completion,
stop_receiving_limit: stop reading the stream early.Likely shape: thread a generic chunk hook + the two limits through
H2ClientRequest(keepingH2Conndecoupled fromnet.http.Request), and havethe shim (
h2_doinbackend.c.v) adapt the request's callbacks to it. Thendrop the
uses_response_streaming()gate so these requests can negotiate h2.Acceptance criteria
on_progress/on_progress_bodyfire per DATA frame on the HTTP/2 path.stop_copying_limit/stop_receiving_limitbehave as on HTTP/1.1.enable_http2: truenegotiate h2 (gate removed).the stop-limit behaviour; a large
download_file_with_progress-style case.References
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.