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

Side by Side Diff: net/tools/quic/quic_simple_server_stream.cc

Issue 2875333002: Landing Recent QUIC changes until Mon May 8 21:42:46 2017 +0000 (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/tools/quic/quic_simple_server_stream.h" 5 #include "net/tools/quic/quic_simple_server_stream.h"
6 6
7 #include <list> 7 #include <list>
8 #include <utility> 8 #include <utility>
9 9
10 #include "net/quic/core/quic_spdy_stream.h" 10 #include "net/quic/core/quic_spdy_stream.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 SpdyHeaderBlock response_headers, 224 SpdyHeaderBlock response_headers,
225 QuicStringPiece body) { 225 QuicStringPiece body) {
226 SendHeadersAndBodyAndTrailers(std::move(response_headers), body, 226 SendHeadersAndBodyAndTrailers(std::move(response_headers), body,
227 SpdyHeaderBlock()); 227 SpdyHeaderBlock());
228 } 228 }
229 229
230 void QuicSimpleServerStream::SendHeadersAndBodyAndTrailers( 230 void QuicSimpleServerStream::SendHeadersAndBodyAndTrailers(
231 SpdyHeaderBlock response_headers, 231 SpdyHeaderBlock response_headers,
232 QuicStringPiece body, 232 QuicStringPiece body,
233 SpdyHeaderBlock response_trailers) { 233 SpdyHeaderBlock response_trailers) {
234 if (!allow_bidirectional_data() && !reading_stopped()) {
235 StopReading();
236 }
237
238 // Send the headers, with a FIN if there's nothing else to send. 234 // Send the headers, with a FIN if there's nothing else to send.
239 bool send_fin = (body.empty() && response_trailers.empty()); 235 bool send_fin = (body.empty() && response_trailers.empty());
240 QUIC_DLOG(INFO) << "Stream " << id() << " writing headers (fin = " << send_fin 236 QUIC_DLOG(INFO) << "Stream " << id() << " writing headers (fin = " << send_fin
241 << ") : " << response_headers.DebugString(); 237 << ") : " << response_headers.DebugString();
242 WriteHeaders(std::move(response_headers), send_fin, nullptr); 238 WriteHeaders(std::move(response_headers), send_fin, nullptr);
243 if (send_fin) { 239 if (send_fin) {
244 // Nothing else to send. 240 // Nothing else to send.
245 return; 241 return;
246 } 242 }
247 243
(...skipping 13 matching lines...) Expand all
261 QUIC_DLOG(INFO) << "Stream " << id() << " writing trailers (fin = true): " 257 QUIC_DLOG(INFO) << "Stream " << id() << " writing trailers (fin = true): "
262 << response_trailers.DebugString(); 258 << response_trailers.DebugString();
263 WriteTrailers(std::move(response_trailers), nullptr); 259 WriteTrailers(std::move(response_trailers), nullptr);
264 } 260 }
265 261
266 const char* const QuicSimpleServerStream::kErrorResponseBody = "bad"; 262 const char* const QuicSimpleServerStream::kErrorResponseBody = "bad";
267 const char* const QuicSimpleServerStream::kNotFoundResponseBody = 263 const char* const QuicSimpleServerStream::kNotFoundResponseBody =
268 "file not found"; 264 "file not found";
269 265
270 } // namespace net 266 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('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