Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3736)

Unified Diff: net/tools/quic/quic_simple_server_stream.cc

Issue 1545793002: Add PushResponse() in QuicSimpleServerStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110546286
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_simple_server_stream.h ('k') | net/tools/quic/quic_simple_server_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_simple_server_stream.cc
diff --git a/net/tools/quic/quic_simple_server_stream.cc b/net/tools/quic/quic_simple_server_stream.cc
index e8d028c7e49d323429e0b0c5aa2bb54d83c14ac3..3a85d84b79f9fea8fd46e3a2fc4328138653b78f 100644
--- a/net/tools/quic/quic_simple_server_stream.cc
+++ b/net/tools/quic/quic_simple_server_stream.cc
@@ -96,6 +96,22 @@ void QuicSimpleServerStream::OnDataAvailable() {
SendResponse();
}
+void QuicSimpleServerStream::PushResponse(
+ SpdyHeaderBlock push_request_headers) {
+ if (id() % 2 != 0) {
+ LOG(DFATAL) << "Client initiated stream shouldn't be used "
+ << "as promised stream.";
+ return;
+ }
+ // Change the stream state to emulate a client request.
+ request_headers_ = push_request_headers;
+ content_length_ = 0;
+ DVLOG(1) << "Stream " << id() << ": Ready to receive server push response.";
+
+ // Set as if stream decompresed the headers and received fin.
+ QuicSpdyStream::OnInitialHeadersComplete(/*fin=*/true, 0);
+}
+
void QuicSimpleServerStream::SendResponse() {
if (!ContainsKey(request_headers_, ":authority") ||
!ContainsKey(request_headers_, ":path")) {
« no previous file with comments | « net/tools/quic/quic_simple_server_stream.h ('k') | net/tools/quic/quic_simple_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698