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

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

Issue 112343002: Merge ReliableQuicStream::WriteData with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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_spdy_server_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_spdy_server_stream.cc
diff --git a/net/tools/quic/quic_spdy_server_stream.cc b/net/tools/quic/quic_spdy_server_stream.cc
index ea23c5968bd9c88143d3e687f4d1acd94cbbb166..dd1100333fa35576e3bcc32c92e22bfbc41ed821 100644
--- a/net/tools/quic/quic_spdy_server_stream.cc
+++ b/net/tools/quic/quic_spdy_server_stream.cc
@@ -71,7 +71,7 @@ void QuicSpdyServerStream::SendHeaders(
string headers_string;
headers_string = session()->compressor()->CompressHeaders(header_block);
- WriteData(headers_string, false);
+ WriteOrBufferData(headers_string, false);
}
int QuicSpdyServerStream::ParseRequestHeaders() {
@@ -109,8 +109,7 @@ void QuicSpdyServerStream::SendResponse() {
}
DLOG(INFO) << "Sending response for stream " << id();
- SendHeaders(response->headers());
- WriteData(response->body(), true);
+ SendHeadersAndBody(response->headers(), response->body());
}
void QuicSpdyServerStream::SendErrorResponse() {
@@ -119,16 +118,18 @@ void QuicSpdyServerStream::SendErrorResponse() {
headers.SetResponseFirstlineFromStringPieces(
"HTTP/1.1", "500", "Server Error");
headers.ReplaceOrAppendHeader("content-length", "3");
- SendHeaders(headers);
- WriteData("bad", true);
+ SendHeadersAndBody(headers, "bad");
}
-QuicConsumedData QuicSpdyServerStream::WriteData(StringPiece data, bool fin) {
+void QuicSpdyServerStream:: SendHeadersAndBody(
+ const BalsaHeaders& response_headers,
+ StringPiece data) {
// We only support SPDY and HTTP, and neither handles bidirectional streaming.
if (!read_side_closed()) {
CloseReadSide();
}
- return ReliableQuicStream::WriteData(data, fin);
+ SendHeaders(response_headers);
+ WriteOrBufferData(data, true);
}
} // namespace tools
« no previous file with comments | « net/tools/quic/quic_spdy_server_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698