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

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

Issue 1541263002: Landing Recent QUIC changes until 12/18/2015 13:57 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: replace -1 with 0xff for InvalidPathId 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 61dae23b3d5eef1712b617a8a7bb326e001e552e..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")) {
@@ -116,7 +132,7 @@ void QuicSimpleServerStream::SendResponse() {
if (response->response_type() == QuicInMemoryCache::CLOSE_CONNECTION) {
DVLOG(1) << "Special response: closing connection.";
- CloseConnection(QUIC_NO_ERROR);
+ CloseConnectionWithDetails(QUIC_NO_ERROR, "Toy server forcing close");
return;
}
« 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