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/http/quic_spdy_session.h b/quic/core/http/quic_spdy_session.h
index 1935a2f..d0978c1 100644
--- a/quic/core/http/quic_spdy_session.h
+++ b/quic/core/http/quic_spdy_session.h
@@ -28,6 +28,12 @@
class QuicSpdySessionPeer;
} // namespace test
+// Unidirectional stream types define by IETF HTTP/3 draft in section 3.2.
+const uint64_t kControlStream = 0;
+const uint64_t kServerPushStream = 1;
+const uint64_t kQpackEncoderStream = 2;
+const uint64_t kQpackDecoderStream = 3;
+
// QuicHpackDebugVisitor gathers data used for understanding HPACK HoL
// dynamics. Specifically, it is to help predict the compression
// penalty of avoiding HoL by chagning how the dynamic table is used.
@@ -198,9 +204,10 @@
// Overridden to buffer incoming unidirectional streams for version 99.
bool UsesPendingStreams() const override;
- // Overridden to Process HTTP/3 stream types. No action will be taken if
- // stream type cannot be read.
- void ProcessPendingStream(PendingStream* pending) override;
+ // Overridden to Process HTTP/3 stream types. H/3 streams will be created from
+ // pending streams accordingly if the stream type can be read. Returns true if
+ // unidirectional streams are created.
+ bool ProcessPendingStream(PendingStream* pending) override;
size_t WriteHeadersOnHeadersStreamImpl(
QuicStreamId id,
@@ -241,10 +248,6 @@
void set_max_uncompressed_header_bytes(
size_t set_max_uncompressed_header_bytes);
- // Creates HTTP/3 unidirectional stream of |id| and |type|. Sends
- // STOP_SENDING frame if |type| is not supported.
- void CreateIncomingStreamFromPending(QuicStreamId id, uint64_t type);
-
private:
friend class test::QuicSpdySessionPeer;