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

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

Issue 14651009: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix integer constant is too large for 'unsigned long' type Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.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 "net/quic/quic_session.h"
7 #include "net/spdy/spdy_framer.h" 8 #include "net/spdy/spdy_framer.h"
8 #include "net/tools/quic/spdy_utils.h" 9 #include "net/tools/quic/spdy_utils.h"
9 10
10 using std::string; 11 using std::string;
11 12
12 namespace net { 13 namespace net {
13 namespace tools { 14 namespace tools {
14 15
15 static const size_t kHeaderBufInitialSize = 4096; 16 static const size_t kHeaderBufInitialSize = 4096;
16 17
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 BalsaHeadersEnums::VALID_CONTENT_LENGTH) && 56 BalsaHeadersEnums::VALID_CONTENT_LENGTH) &&
56 mutable_body()->size() != headers().content_length()) { 57 mutable_body()->size() != headers().content_length()) {
57 SendErrorResponse(); // Invalid content length 58 SendErrorResponse(); // Invalid content length
58 } else { 59 } else {
59 SendResponse(); 60 SendResponse();
60 } 61 }
61 } 62 }
62 63
63 void QuicSpdyServerStream::SendHeaders( 64 void QuicSpdyServerStream::SendHeaders(
64 const BalsaHeaders& response_headers) { 65 const BalsaHeaders& response_headers) {
66 SpdyHeaderBlock header_block =
67 SpdyUtils::ResponseHeadersToSpdyHeaders(response_headers);
65 string headers = 68 string headers =
66 SpdyUtils::SerializeResponseHeaders(response_headers); 69 session()->compressor()->CompressHeaders(header_block);
70
67 WriteData(headers, false); 71 WriteData(headers, false);
68 } 72 }
69 73
70 int QuicSpdyServerStream::ParseRequestHeaders() { 74 int QuicSpdyServerStream::ParseRequestHeaders() {
71 size_t read_buf_len = static_cast<size_t>(read_buf_->offset()); 75 size_t read_buf_len = static_cast<size_t>(read_buf_->offset());
72 SpdyFramer framer(3); 76 SpdyFramer framer(3);
73 SpdyHeaderBlock headers; 77 SpdyHeaderBlock headers;
74 char* data = read_buf_->StartOfBuffer(); 78 char* data = read_buf_->StartOfBuffer();
75 size_t len = framer.ParseHeaderBlockInBuffer(data, read_buf_->offset(), 79 size_t len = framer.ParseHeaderBlockInBuffer(data, read_buf_->offset(),
76 &headers); 80 &headers);
(...skipping 10 matching lines...) Expand all
87 if (delta > 0) { 91 if (delta > 0) {
88 mutable_body()->append(data + len, delta); 92 mutable_body()->append(data + len, delta);
89 } 93 }
90 94
91 request_headers_received_ = true; 95 request_headers_received_ = true;
92 return len; 96 return len;
93 } 97 }
94 98
95 } // namespace tools 99 } // namespace tools
96 } // namespace net 100 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.cc ('k') | net/tools/quic/spdy_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698