Allow OgHttp2Session to blackhole data on connection errors.

This CL adds an option to OgHttp2Session::Options that will cause
OgHttp2Session to behave more similarly to nghttp2 when encountering
connection-level errors while processing data. Specifically:
  1. When encountering connection errors, send a GOAWAY but mark the entire
     input as consumed [1], i.e., be a sink.
  2. When a connection-error GOAWAY is sent, be a sink for subsequent
     ProcessBytes() calls [2].
  3. Return errors only for bad client magic or user callback failures [3].

Each of the pre-existing affected oghttp2 tests in this CL with nghttp2
analogues now have aligned ProcessBytes() return values.

Having this option enabled in Envoy is a prerequisite for codec_impl_test
LargeServerBodyFlushTimeoutAfterGoaway to pass.

[1] e.g., http://google3/third_party/nghttp2/src/lib/nghttp2_session.c;l=5428-5435;rcl=314948637.
    There are more examples of this pattern throughout nghttp2_session_mem_recv().
[2] http://google3/third_party/nghttp2/src/lib/nghttp2_session.c;l=5382-5384;rcl=314948637
[3] There are technically two other possible negative return values, but I don't think Envoy considers NGHTTP2_ERR_NOMEM, and Envoy is also skeptical about NGHTTP2_ERR_FLOODED: http://google3/third_party/envoy/src/source/common/http/http2/;l=844-851;rcl=415656746, http://google3/third_party/envoy/src/source/common/http/http2/;l=1726-1732;rcl=415656746.

PiperOrigin-RevId: 417432491
4 files changed
tree: 8962ed70982c558299ecfe784a28d73387fb78cc
  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.