Fix sending MAX_PUSH_ID frame during 0-RTT.

Assume SetMaxPushId() is called with some initial value.  During 0-RTT,
SendInitialData() is called, it sends a MAX_PUSH_ID and sets
|http3_max_push_id_sent_|.  If SetMaxPushId() is called with a different value
after this but before 1-RTT keys are available, it does not send the MAX_PUSH_ID
frame with the updated value because OneRttKeysAvailable() is false.  Then
SendInitialData() is called when 1-RTT keys are available, but it does not send
the updated MAX_PUSH_ID frame either, because |http3_max_push_id_sent_| is true.

This CL fixes that by gating on IsEncryptionEstablished() instead of
OneRttKeysAvailable() in SetMaxPushId().  However, it introduces a new bug:

Assume there is no initial SetMaxPushId() call.  During 0-RTT, SendInitialData()
is called, but it does not send a MAX_PUSH_ID frame because |max_push_id_| is
not set.  Then SetMaxPushId() is called before 1-RTT keys are available, and it
now sends the MAX_PUSH_ID frame because IsEncryptionEstablished() is true.  Then
SendInitialData() is called when 1-RTT keys are available.  It should not send
another MAX_PUSH_ID frame with the same value.  In order to achieve this,
|http3_max_push_id_sent_| must be set to true when the MAX_PUSH_ID frame is sent
by SetMaxPushId().  This is done by setting |http3_max_push_id_sent_| in
SendMaxPushId() instead of SendInitialData().

Client-only change.

PiperOrigin-RevId: 315734365
Change-Id: Ib4dc2f96624b1c8c9a27916aa4a6ab98fbb71494
3 files changed
tree: 139509c77585ac3a2be5c1d35d0c6866839f7401
  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.