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

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

Issue 1006193003: Remove Balsa from QuicSpdyClientStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 5 years, 9 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
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream_test.cc ('k') | net/tools/quic/spdy_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_spdy_server_stream.h" 5 #include "net/tools/quic/quic_spdy_server_stream.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "net/quic/quic_session.h" 8 #include "net/quic/quic_session.h"
9 #include "net/spdy/spdy_framer.h" 9 #include "net/spdy/spdy_framer.h"
10 #include "net/tools/quic/quic_in_memory_cache.h" 10 #include "net/tools/quic/quic_in_memory_cache.h"
(...skipping 24 matching lines...) Expand all
35 if (request_headers_.empty()) { 35 if (request_headers_.empty()) {
36 if (!ParseRequestHeaders(data, data_len)) { 36 if (!ParseRequestHeaders(data, data_len)) {
37 // Headers were invalid. 37 // Headers were invalid.
38 SendErrorResponse(); 38 SendErrorResponse();
39 return 0; 39 return 0;
40 } 40 }
41 } else { 41 } else {
42 body_.append(data, data_len); 42 body_.append(data, data_len);
43 } 43 }
44 DCHECK(!request_headers_.empty()); 44 DCHECK(!request_headers_.empty());
45 if (content_length_ > 0 && static_cast<int>(body_.size()) > content_length_) { 45 if (content_length_ >= 0 &&
46 static_cast<int>(body_.size()) > content_length_) {
46 SendErrorResponse(); 47 SendErrorResponse();
47 return 0; 48 return 0;
48 } 49 }
49 DVLOG(1) << "Processed " << data_len << " bytes for stream " << id(); 50 DVLOG(1) << "Processed " << data_len << " bytes for stream " << id();
50 return data_len; 51 return data_len;
51 } 52 }
52 53
53 void QuicSpdyServerStream::OnFinRead() { 54 void QuicSpdyServerStream::OnFinRead() {
54 ReliableQuicStream::OnFinRead(); 55 ReliableQuicStream::OnFinRead();
55 if (write_side_closed() || fin_buffered()) { 56 if (write_side_closed() || fin_buffered()) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 144
144 WriteHeaders(response_headers, body.empty(), nullptr); 145 WriteHeaders(response_headers, body.empty(), nullptr);
145 146
146 if (!body.empty()) { 147 if (!body.empty()) {
147 WriteOrBufferData(body, true, nullptr); 148 WriteOrBufferData(body, true, nullptr);
148 } 149 }
149 } 150 }
150 151
151 } // namespace tools 152 } // namespace tools
152 } // namespace net 153 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream_test.cc ('k') | net/tools/quic/spdy_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698