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