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

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

Issue 2430973004: Landing Recent QUIC changes until 10:38 AM, Oct 17, 2016 UTC-4 (Closed)
Patch Set: Improving flagsaver logging Created 4 years, 2 months 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_dispatcher_test.cc ('k') | net/tools/quic/quic_spdy_client_stream.h » ('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 685955f3c616e588c734a2cca4b58fe1719eec11..cd4e5ef135fef9225f4c65f8629086ab88324a48 100644
--- a/net/tools/quic/quic_simple_server_stream.cc
+++ b/net/tools/quic/quic_simple_server_stream.cc
@@ -103,20 +103,6 @@ void QuicSimpleServerStream::OnDataAvailable() {
return;
}
- if (request_headers_.empty()) {
- DVLOG(1) << "Request headers empty.";
- SendErrorResponse();
- return;
- }
-
- if (content_length_ > 0 &&
- static_cast<uint64_t>(content_length_) != body_.size()) {
- DVLOG(1) << "Content length (" << content_length_ << ") != body size ("
- << body_.size() << ").";
- SendErrorResponse();
- return;
- }
-
SendResponse();
}
@@ -136,6 +122,20 @@ void QuicSimpleServerStream::PushResponse(
}
void QuicSimpleServerStream::SendResponse() {
+ if (request_headers_.empty()) {
+ DVLOG(1) << "Request headers empty.";
+ SendErrorResponse();
+ return;
+ }
+
+ if (content_length_ > 0 &&
+ static_cast<uint64_t>(content_length_) != body_.size()) {
+ DVLOG(1) << "Content length (" << content_length_ << ") != body size ("
+ << body_.size() << ").";
+ SendErrorResponse();
+ return;
+ }
+
if (!base::ContainsKey(request_headers_, ":authority") ||
!base::ContainsKey(request_headers_, ":path")) {
DVLOG(1) << "Request headers do not contain :authority or :path.";
@@ -234,9 +234,7 @@ void QuicSimpleServerStream::SendHeadersAndBodyAndTrailers(
SpdyHeaderBlock response_headers,
StringPiece body,
SpdyHeaderBlock response_trailers) {
- // This server only supports SPDY and HTTP, and neither handles bidirectional
- // streaming.
- if (!reading_stopped()) {
+ if (!allow_bidirectional_data() && !reading_stopped()) {
StopReading();
}
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_spdy_client_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698