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

Side by Side Diff: trunk/src/net/tools/quic/quic_spdy_client_stream.cc

Issue 15018013: Revert 198736 "Land Recent QUIC changes" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
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_client_stream.h" 5 #include "net/tools/quic/quic_spdy_client_stream.h"
6 6
7 #include "net/spdy/spdy_framer.h" 7 #include "net/spdy/spdy_framer.h"
8 #include "net/tools/quic/quic_client_session.h" 8 #include "net/tools/quic/quic_client_session.h"
9 #include "net/tools/quic/spdy_utils.h" 9 #include "net/tools/quic/spdy_utils.h"
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } else if ((headers().content_length_status() == 52 } else if ((headers().content_length_status() ==
53 BalsaHeadersEnums::VALID_CONTENT_LENGTH) && 53 BalsaHeadersEnums::VALID_CONTENT_LENGTH) &&
54 mutable_data()->size() != headers().content_length()) { 54 mutable_data()->size() != headers().content_length()) {
55 Close(QUIC_BAD_APPLICATION_PAYLOAD); 55 Close(QUIC_BAD_APPLICATION_PAYLOAD);
56 } 56 }
57 } 57 }
58 58
59 ssize_t QuicSpdyClientStream::SendRequest(const BalsaHeaders& headers, 59 ssize_t QuicSpdyClientStream::SendRequest(const BalsaHeaders& headers,
60 StringPiece body, 60 StringPiece body,
61 bool fin) { 61 bool fin) {
62 SpdyHeaderBlock header_block = 62 string headers_string = SpdyUtils::SerializeRequestHeaders(headers);
63 SpdyUtils::RequestHeadersToSpdyHeaders(headers);
64
65 string headers_string =
66 session()->compressor()->CompressHeaders(header_block);
67 63
68 bool has_body = !body.empty(); 64 bool has_body = !body.empty();
69 65
70 WriteData(headers_string, fin && !has_body); 66 WriteData(headers_string, fin && !has_body);
71 67
72 if (has_body) { 68 if (has_body) {
73 WriteData(body, fin); 69 WriteData(body, fin);
74 } 70 }
75 71
76 return headers_string.size() + body.size(); 72 return headers_string.size() + body.size();
(...skipping 18 matching lines...) Expand all
95 size_t delta = read_buf_len - len; 91 size_t delta = read_buf_len - len;
96 if (delta > 0) { 92 if (delta > 0) {
97 mutable_data()->append(data + len, delta); 93 mutable_data()->append(data + len, delta);
98 } 94 }
99 95
100 return len; 96 return len;
101 } 97 }
102 98
103 } // namespace tools 99 } // namespace tools
104 } // namespace net 100 } // namespace net
OLDNEW
« no previous file with comments | « trunk/src/net/tools/quic/quic_reliable_server_stream_test.cc ('k') | trunk/src/net/tools/quic/quic_spdy_server_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698