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

Side by Side Diff: net/http/http_stream_parser.h

Issue 1884943003: HttpStreamParser: Don't reuse sockets which receive unparsed data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops Created 4 years, 6 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
« no previous file with comments | « net/http/http_response_body_drainer_unittest.cc ('k') | net/http/http_stream_parser.cc » ('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 #ifndef NET_HTTP_HTTP_STREAM_PARSER_H_ 5 #ifndef NET_HTTP_HTTP_STREAM_PARSER_H_
6 #define NET_HTTP_HTTP_STREAM_PARSER_H_ 6 #define NET_HTTP_HTTP_STREAM_PARSER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // -1 if not found yet. 216 // -1 if not found yet.
217 int response_header_start_offset_; 217 int response_header_start_offset_;
218 218
219 // The amount of received data. If connection is reused then intermediate 219 // The amount of received data. If connection is reused then intermediate
220 // value may be bigger than final. 220 // value may be bigger than final.
221 int64_t received_bytes_; 221 int64_t received_bytes_;
222 222
223 // The amount of sent data. 223 // The amount of sent data.
224 int64_t sent_bytes_; 224 int64_t sent_bytes_;
225 225
226 // The parsed response headers. Owned by the caller of SendRequest. This 226 // The parsed response headers. Owned by the caller of SendRequest. This
227 // cannot be safely accessed after reading the final set of headers, as the 227 // cannot be safely accessed after reading the final set of headers, as the
228 // caller of SendRequest may have been destroyed - this happens in the case an 228 // caller of SendRequest may have been destroyed - this happens in the case an
229 // HttpResponseBodyDrainer is used. 229 // HttpResponseBodyDrainer is used.
230 HttpResponseInfo* response_; 230 HttpResponseInfo* response_;
231 231
232 // Indicates the content length. If this value is less than zero 232 // Indicates the content length. If this value is less than zero
233 // (and chunked_decoder_ is null), then we must read until the server 233 // (and chunked_decoder_ is null), then we must read until the server
234 // closes the connection. 234 // closes the connection.
235 int64_t response_body_length_; 235 int64_t response_body_length_;
236 236
237 // True if reading a keep-alive response. False if not, or if don't yet know.
238 bool response_is_keep_alive_;
239
237 // Keep track of the number of response body bytes read so far. 240 // Keep track of the number of response body bytes read so far.
238 int64_t response_body_read_; 241 int64_t response_body_read_;
239 242
240 // Helper if the data is chunked. 243 // Helper if the data is chunked.
241 std::unique_ptr<HttpChunkedDecoder> chunked_decoder_; 244 std::unique_ptr<HttpChunkedDecoder> chunked_decoder_;
242 245
243 // Where the caller wants the body data. 246 // Where the caller wants the body data.
244 scoped_refptr<IOBuffer> user_read_buf_; 247 scoped_refptr<IOBuffer> user_read_buf_;
245 int user_read_buf_len_; 248 int user_read_buf_len_;
246 249
(...skipping 26 matching lines...) Expand all
273 int upload_error_; 276 int upload_error_;
274 277
275 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; 278 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_;
276 279
277 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); 280 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser);
278 }; 281 };
279 282
280 } // namespace net 283 } // namespace net
281 284
282 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ 285 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_
OLDNEW
« no previous file with comments | « net/http/http_response_body_drainer_unittest.cc ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698