Simplify HttpDecoder state transitions.

Both before and after this CL, non-buffered frames go through the following
states:
  STATE_READING_FRAME_LENGTH
  STATE_READING_FRAME_TYPE
  STATE_READING_FRAME_PAYLOAD
  STATE_FINISH_PARSING
They skip STATE_READING_FRAME_PAYLOAD if the payload is empty.

Before this CL, buffered frames normally skip STATE_FINISH_PARSING, except they
skip STATE_READING_FRAME_PAYLOAD if payload is empty just like non-buffered
states, and therefore they have to go through STATE_FINISH_PARSING.
ReadFramePayload() corresponds to STATE_READING_FRAME_PAYLOAD and
FinishParsing() corresponds to STATE_FINISH_PARSING, and states are only changed
in methods that correspond to states, except for the helper
BufferOrParsePayload() which does not have a corresponding state but can still
change the state, which its caller must detect.

After this CL, the states STATE_READING_FRAME_PAYLOAD and STATE_FINISH_PARSING
only process non-buffered frames, and buffered frames go through a dedicated new
state STATE_BUFFER_OR_PARSE_PAYLOAD.  The state transition path forks in
ReadFrameLength().  BufferOrParsePayload() gets promoted from a random helper
called from other methods to a method corresponding to a state, called from
ProcessInput() which drives the state machine.  State transitions are now
cleaner.

PiperOrigin-RevId: 399487182
2 files changed
tree: 8098d1c1f8a89c20a34ca6101db79ae9b2b8e04e
  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.