Fix content-length validation for trailers.

This CL fixes a bug in content-length validation when trailers end the stream:
  1. End of headers, stores content-length for validation
  2. End of data, does not end stream and does not match content-length
  3. End of trailers, ends stream and stores content-length for validation (!)

The re-storing of content-length at the end of trailers erases the previous
validation at the end of data. This CL fixes Step 3 to avoid storing
content-length for trailers.

http://sponge2/e572060c-8ff8-45a8-b3b3-25994345b2bb (demonstrates RST_STREAM)

PiperOrigin-RevId: 422904538
4 files changed
tree: 7f0448e53ae65406fbb689e3946ebea858ae0b28
  1. common/
  2. epoll_server/
  3. http2/
  4. quic/
  5. spdy/


QUICHE stands for QUIC, Http/2, Etc. It is Google‘s production-ready implementation of QUIC, HTTP/2, HTTP/3, and related protocols and tools. It powers Google’s servers, Chromium, Envoy, and other projects. It is actively developed and maintained.

There are two public QUICHE repositories. Either one may be used by embedders, as they are automatically kept in sync:

To embed QUICHE in your project, platform APIs need to be implemented and build files need to be created. Note that it is on the QUICHE team's roadmap to include default implementation for all platform APIs and to open-source build files. In the meanwhile, take a look at open source embedders like Chromium and Envoy to get started:

To contribute to QUICHE, follow instructions at

QUICHE is only supported on little-endian platforms.