OLD | NEW |
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 StringPiece body, | 60 StringPiece body, |
61 bool fin) { | 61 bool fin) { |
62 SpdyHeaderBlock header_block = | 62 SpdyHeaderBlock header_block = |
63 SpdyUtils::RequestHeadersToSpdyHeaders(headers); | 63 SpdyUtils::RequestHeadersToSpdyHeaders(headers); |
64 | 64 |
65 string headers_string = | 65 string headers_string = |
66 session()->compressor()->CompressHeaders(header_block); | 66 session()->compressor()->CompressHeaders(header_block); |
67 | 67 |
68 bool has_body = !body.empty(); | 68 bool has_body = !body.empty(); |
69 | 69 |
70 WriteData(headers_string, fin && !has_body); | 70 WriteData(headers_string, fin && !has_body); // last_data |
71 | 71 |
72 if (has_body) { | 72 if (has_body) { |
73 WriteData(body, fin); | 73 WriteData(body, fin); |
74 } | 74 } |
75 | 75 |
76 return headers_string.size() + body.size(); | 76 return headers_string.size() + body.size(); |
77 } | 77 } |
78 | 78 |
79 int QuicSpdyClientStream::ParseResponseHeaders() { | 79 int QuicSpdyClientStream::ParseResponseHeaders() { |
80 size_t read_buf_len = static_cast<size_t>(read_buf_->offset()); | 80 size_t read_buf_len = static_cast<size_t>(read_buf_->offset()); |
(...skipping 14 matching lines...) Expand all Loading... |
95 size_t delta = read_buf_len - len; | 95 size_t delta = read_buf_len - len; |
96 if (delta > 0) { | 96 if (delta > 0) { |
97 mutable_data()->append(data + len, delta); | 97 mutable_data()->append(data + len, delta); |
98 } | 98 } |
99 | 99 |
100 return len; | 100 return len; |
101 } | 101 } |
102 | 102 |
103 } // namespace tools | 103 } // namespace tools |
104 } // namespace net | 104 } // namespace net |
OLD | NEW |