| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/quic/quic_spdy_server_stream.h" | 5 #include "net/quic/quic_spdy_server_stream.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "net/quic/quic_in_memory_cache.h" | 8 #include "net/quic/quic_in_memory_cache.h" |
| 9 #include "net/quic/quic_session.h" | 9 #include "net/quic/quic_session.h" |
| 10 #include "net/spdy/spdy_framer.h" | 10 #include "net/spdy/spdy_framer.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 SendErrorResponse(); // We're not done reading headers. | 57 SendErrorResponse(); // We're not done reading headers. |
| 58 } else if ((headers_.content_length_status() == | 58 } else if ((headers_.content_length_status() == |
| 59 BalsaHeadersEnums::VALID_CONTENT_LENGTH) && | 59 BalsaHeadersEnums::VALID_CONTENT_LENGTH) && |
| 60 body_.size() != headers_.content_length()) { | 60 body_.size() != headers_.content_length()) { |
| 61 SendErrorResponse(); // Invalid content length | 61 SendErrorResponse(); // Invalid content length |
| 62 } else { | 62 } else { |
| 63 SendResponse(); | 63 SendResponse(); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 int QuicSpdyServerStream::ParseRequestHeaders() { | 67 size_t QuicSpdyServerStream::ParseRequestHeaders() { |
| 68 size_t read_buf_len = static_cast<size_t>(read_buf_->offset()); | 68 size_t read_buf_len = static_cast<size_t>(read_buf_->offset()); |
| 69 SpdyFramer framer(SPDY3); | 69 SpdyFramer framer(SPDY3); |
| 70 SpdyHeaderBlock headers; | 70 SpdyHeaderBlock headers; |
| 71 char* data = read_buf_->StartOfBuffer(); | 71 char* data = read_buf_->StartOfBuffer(); |
| 72 size_t len = framer.ParseHeaderBlockInBuffer(data, read_buf_->offset(), | 72 size_t len = framer.ParseHeaderBlockInBuffer(data, read_buf_->offset(), |
| 73 &headers); | 73 &headers); |
| 74 if (len == 0) { | 74 if (len == 0) { |
| 75 return -1; | 75 return -1; |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 SpdyUtils::ResponseHeadersToSpdyHeaders(response_headers); | 134 SpdyUtils::ResponseHeadersToSpdyHeaders(response_headers); |
| 135 | 135 |
| 136 WriteHeaders(header_block, body.empty(), NULL); | 136 WriteHeaders(header_block, body.empty(), NULL); |
| 137 | 137 |
| 138 if (!body.empty()) { | 138 if (!body.empty()) { |
| 139 WriteOrBufferData(body, true, NULL); | 139 WriteOrBufferData(body, true, NULL); |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace net | 143 } // namespace net |
| OLD | NEW |