Make the toy QUIC server send responses of arbitrary length based a number specified in the path.
gfe-relnote: n/a - Tools-only code
PiperOrigin-RevId: 274840831
Change-Id: Ia22584f9ae202896f268a47172e15e8d1a9a75f8
diff --git a/quic/tools/quic_simple_server_stream.h b/quic/tools/quic_simple_server_stream.h
index ace1571..594ca02 100644
--- a/quic/tools/quic_simple_server_stream.h
+++ b/quic/tools/quic_simple_server_stream.h
@@ -38,6 +38,7 @@
void OnTrailingHeadersComplete(bool fin,
size_t frame_len,
const QuicHeaderList& header_list) override;
+ void OnCanWrite() override;
// QuicStream implementation called by the sequencer when there is
// data (or a FIN) to be read.
@@ -88,12 +89,17 @@
const std::string& body() { return body_; }
+ // Writes the body bytes for the GENERATE_BYTES response type.
+ void WriteGeneratedBytes();
+
// The parsed headers received from the client.
spdy::SpdyHeaderBlock request_headers_;
int64_t content_length_;
std::string body_;
private:
+ uint64_t generate_bytes_length_;
+
QuicSimpleServerBackend* quic_simple_server_backend_; // Not owned.
};