Harden QuicStream::flow_controller_

This CL unblocks merge. Calling QuicheOptional::operator-> when there is no value present is undefined behavior. Chrome's implementation of QuicheOptional is more strict than the C++ standard library used in google3, and in debug builds it asserts when operator-> is used even though there is no value present. This is causing tests to fail and blocking merge.

This CL protects every single call to QuicStream::flow_controller_::operator-> with a check that verifies that a value was present. In almost all cases, it adds a QUIC_BUG to prove that this never happens in practice. The only case that does not have a QUIC_BUG is inside OnClose because this seems to be leveraged by multiple of our tests (QuicSessionTestClient.InvalidStreamFlowControlWindowInHandshake, QuicSessionTestServer.DontCallOnWriteBlockedForDisconnectedConnection, QuicSpdySessionTestClient.BadStreamFramePendingStream). We've confirmed that this CL fixes the merge issue.

Avoid undefined behavior, not flag protected

PiperOrigin-RevId: 311355214
Change-Id: I0e7d8c0c97815e1ed6f19509f0e64dfda8a32e5c
1 file changed
tree: a07935d91a97b27400b0e3b68e4f017217006be5
  1. common/
  2. epoll_server/
  3. http2/
  4. quic/
  5. spdy/
  6. CONTRIBUTING.md
  7. LICENSE
  8. README.md
README.md

QUICHE

QUICHE (QUIC, Http/2, Etc) is Google‘s implementation of QUIC and related protocols. It powers Chromium as well as Google’s QUIC servers and some other projects.