| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 string headers_string = SpdyUtils::SerializeRequestHeaders(headers); | 62 SpdyHeaderBlock header_block = |
| 63 SpdyUtils::RequestHeadersToSpdyHeaders(headers); |
| 64 |
| 65 string headers_string = |
| 66 session()->compressor()->CompressHeaders(header_block); |
| 63 | 67 |
| 64 bool has_body = !body.empty(); | 68 bool has_body = !body.empty(); |
| 65 | 69 |
| 66 WriteData(headers_string, fin && !has_body); | 70 WriteData(headers_string, fin && !has_body); |
| 67 | 71 |
| 68 if (has_body) { | 72 if (has_body) { |
| 69 WriteData(body, fin); | 73 WriteData(body, fin); |
| 70 } | 74 } |
| 71 | 75 |
| 72 return headers_string.size() + body.size(); | 76 return headers_string.size() + body.size(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 91 size_t delta = read_buf_len - len; | 95 size_t delta = read_buf_len - len; |
| 92 if (delta > 0) { | 96 if (delta > 0) { |
| 93 mutable_data()->append(data + len, delta); | 97 mutable_data()->append(data + len, delta); |
| 94 } | 98 } |
| 95 | 99 |
| 96 return len; | 100 return len; |
| 97 } | 101 } |
| 98 | 102 |
| 99 } // namespace tools | 103 } // namespace tools |
| 100 } // namespace net | 104 } // namespace net |
| OLD | NEW |