Support HTTP/3 style of Server push.
Server push stream now has stream type of 0x01 encoded as variable length integer. It will be sent along with the first stream write. And the peer will open the incoming stream once the stream type byte is received.
Pending stream is enabled in this CL.
gfe-relnote: version 99 only. Not in production.
PiperOrigin-RevId: 249914001
Change-Id: I291d1cc98ce44f930722608f82f9829da033c213
diff --git a/quic/core/quic_stream.cc b/quic/core/quic_stream.cc
index 32b168d..94cffd4 100644
--- a/quic/core/quic_stream.cc
+++ b/quic/core/quic_stream.cc
@@ -68,8 +68,9 @@
}
void PendingStream::AddBytesConsumed(QuicByteCount bytes) {
- QUIC_BUG << "AddBytesConsumed should not be called.";
- CloseConnectionWithDetails(QUIC_INTERNAL_ERROR, "Unexpected bytes consumed");
+ // It will be called when the metadata of the stream is consumed.
+ flow_controller_.AddBytesConsumed(bytes);
+ connection_flow_controller_->AddBytesConsumed(bytes);
}
void PendingStream::Reset(QuicRstStreamErrorCode error) {
@@ -168,6 +169,10 @@
return true;
}
+void PendingStream::MarkConsumed(size_t num_bytes) {
+ sequencer_.MarkConsumed(num_bytes);
+}
+
QuicStream::QuicStream(PendingStream pending, StreamType type, bool is_static)
: QuicStream(pending.id_,
pending.session_,