trillium-http-v1.3.0
·
80 commits
to main
since this release
Added
Upgrade::send_trailers(self, &Headers) -> io::Result<()>— emit trailing headers and finish the outbound stream. On HTTP/1.1 withTransfer-Encoding: chunkedset on the response, writes the last-chunk marker, trailer section, and final CRLF, then closes the transport. On HTTP/2, enqueues a trailingHEADERSframe withEND_STREAMvia the connection driver. On HTTP/3, encodes a trailingHEADERSframe via QPACK and closes the stream. On HTTP/1.x without chunked framing trailers are dropped with alog::warn!.Upgrade::received_trailers() -> Option<&Headers>(with_mutandtake_variants) — inbound trailers carried across the upgrade transition or decoded by the post-upgrade inbound state machine.
Changed
Upgrade::request_headersand associated accessors are deprecated in preference toUpgrade::received_headersUpgrade::response_headersand associated accessors are deprecated in preference toUpgrade::sent_headers
Fixed
- HTTP/2 requests did not prevent graceful shutdown. Now they do.
- The
AsyncWrite/AsyncReadimplementations onUpgradenow correctly applies per-protocol framing/deframing instead of raw passthrough. Previously, only HTTP/2 applied framing. Now, HTTP/1.1 withTransfer-Encoding: chunkedheaders encodes/decodes appropriate chunk framing, and HTTP/3 encodes/decodes DATA framing. HTTP/1.x withoutTransfer-Encoding: Chunkedcontinues to pass through transparently. - Reading an HTTP/1.1 chunked-encoded body — request bodies in the server role, response bodies in the client role — could in rare cases fail to decode despite the wire being well-formed, surfacing as one of
chunk header too long,invalid chunk size,ConnectionAborted, orUnexpectedEof. The triggers all sat at the intersection of partial chunk-size headers (caused by transport segmentation landing inside the few-byte chunk-size header window) and content already buffered for processing (either residual from the conn's pre-read scratch, or partial header bytes stashed by a prior poll). Well-behaved clients use sensible chunk sizes, and reverse proxies typically re-frame chunked bodies before forwarding to the backend, so traffic in typical deployments was very unlikely to hit any of these. Decode errors are now surfaced only for genuinely malformed bodies or actual transport closure. Outbound chunked encoding (the write path in either role) was never affected. - Client-role responses from HTTP/1.0 servers that omit
Content-Length(read-to-close framing) now decode correctly. Previously these surfaced as chunked-decode errors because the inbound body was routed through the chunked decoder.