Do not pretend receiving FIN when receiving trailers in QUIC v99.
In Google QUIC, trailing HEADERS must have FIN bit. In IETF QUIC, HTTP/3 frames
do not have flags, so trailing HEADERS will never have FIN. This CL makes
QuicSpdyStream stop faking a FIN bit.
In non-v99 QUIC, |fin| must be true at the end of OnTrailingHeadersComplete(),
otherwise the connection would have been closed in line 568.
In v99 QUIC, |fin| is false in production, when OnStreamHeaderList() is called
from OnHeadersFrameEnd(). However, a large number of tests call
OnStreamHeaderList() with fin = true, so this needs to be supported for the time
being. See linked bug.
This is prework for https://crbug.com/978733. I do not want QuicSpdyStream to
close the connection when trailers arrive, so that it can signal an error if
other frames are received afterwards.
Also, according to
https://quicwg.org/base-drafts/draft-ietf-quic-http.html#request-response,
PUSH_PROMISE frames can arrive after trailers, so the stream really should
remain open.
This CL also fixes descriptions of some QuicSpdyStream methods related to FIN
flag.
gfe-relnote: n/a, QUIC v99-only change.
PiperOrigin-RevId: 255681867
Change-Id: I33928191e35d601514a0be5b18b8aa5ff389c831
diff --git a/quic/core/http/quic_spdy_stream_test.cc b/quic/core/http/quic_spdy_stream_test.cc
index 2cb4bce..bab9228 100644
--- a/quic/core/http/quic_spdy_stream_test.cc
+++ b/quic/core/http/quic_spdy_stream_test.cc
@@ -1752,7 +1752,7 @@
EXPECT_TRUE(stream_->trailers_decompressed());
EXPECT_EQ(trailers_block, stream_->received_trailers());
- EXPECT_FALSE(stream_->IsDoneReading());
+ EXPECT_TRUE(stream_->HasBytesToRead());
// Consume data.
char buffer[2048];
@@ -1762,7 +1762,7 @@
size_t bytes_read = stream_->Readv(&vec, 1);
EXPECT_EQ(kDataFramePayload, QuicStringPiece(buffer, bytes_read));
- EXPECT_TRUE(stream_->IsDoneReading());
+ EXPECT_FALSE(stream_->HasBytesToRead());
}
// The test stream will receive a stream frame containing malformed headers and