Do not preallocate memory in HttpDecoder for frame payload.

DATA, HEADERS, and unknown frame payload fragments are passed immediately to
Visitor without buffering.  CANCEL_PUSH and PUSH_PROMISE frames are not
processed.  GOAWAY and MAX_PUSH_ID frames have small payloads.  Only SETTINGS,
PRIORITY_UPDATE, and ACCEPT_CH frames may be buffered by HttpDecoder and are
allowed to have large payloads.  In most cases these frames are small and the
payload is sent in a single fragment, in which case HttpDecoder parses it
directly from the input without buffering.  Buffering only happens in the rest
of the cases, which clearly is not a hot path.  This CL changes HttpDecoder not
to preallocate memory for the payload buffer in these cases, and let std::string
deal with growing internally.

Also introduce kPayloadLengthLimit constant, and do not call MaxFrameLength()
for frames that are not buffered.

PiperOrigin-RevId: 399421301
1 file changed
tree: a8566b3f4d02cb28e8210a142f9c21bfecf0e9c8
  1. common/
  2. epoll_server/
  3. http2/
  4. quic/
  5. spdy/
  6. CONTRIBUTING.md
  7. LICENSE
  8. README.md
README.md

QUICHE

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 CONTRIBUTING.md.

QUICHE is only supported on little-endian platforms.