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

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

Issue 10919167: Increase the sizes of the circular buffers used by SSLClientSocketNSS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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/http/http_stream_parser.h" 5 #include "net/http/http_stream_parser.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "net/base/address_list.h" 11 #include "net/base/address_list.h"
12 #include "net/base/auth.h" 12 #include "net/base/auth.h"
13 #include "net/base/io_buffer.h" 13 #include "net/base/io_buffer.h"
14 #include "net/base/ssl_cert_request_info.h" 14 #include "net/base/ssl_cert_request_info.h"
15 #include "net/http/http_request_headers.h" 15 #include "net/http/http_request_headers.h"
16 #include "net/http/http_request_info.h" 16 #include "net/http/http_request_info.h"
17 #include "net/http/http_response_headers.h" 17 #include "net/http/http_response_headers.h"
18 #include "net/http/http_util.h" 18 #include "net/http/http_util.h"
19 #include "net/socket/ssl_client_socket.h" 19 #include "net/socket/ssl_client_socket.h"
20 #include "net/socket/client_socket_handle.h" 20 #include "net/socket/client_socket_handle.h"
21 21
22 namespace { 22 namespace {
23 23
24 const size_t kMaxMergedHeaderAndBodySize = 1400; 24 const size_t kMaxMergedHeaderAndBodySize = 1400;
25 const size_t kRequestBodyBufferSize = 1 << 14; // 16KB 25 const size_t kRequestBodyBufferSize = 1 << 14; // 16KB <= XXX This is the large st write buffer.
wtc 2012/09/07 23:18:54 This comment is intended to help code review. It w
26 26
27 std::string GetResponseHeaderLines(const net::HttpResponseHeaders& headers) { 27 std::string GetResponseHeaderLines(const net::HttpResponseHeaders& headers) {
28 std::string raw_headers = headers.raw_headers(); 28 std::string raw_headers = headers.raw_headers();
29 const char* null_separated_headers = raw_headers.c_str(); 29 const char* null_separated_headers = raw_headers.c_str();
30 const char* header_line = null_separated_headers; 30 const char* header_line = null_separated_headers;
31 std::string cr_separated_headers; 31 std::string cr_separated_headers;
32 while (header_line[0] != 0) { 32 while (header_line[0] != 0) {
33 cr_separated_headers += header_line; 33 cr_separated_headers += header_line;
34 cr_separated_headers += "\n"; 34 cr_separated_headers += "\n";
35 header_line += strlen(header_line) + 1; 35 header_line += strlen(header_line) + 1;
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 request_body->IsInMemory() && 969 request_body->IsInMemory() &&
970 request_body->size() > 0) { 970 request_body->size() > 0) {
971 size_t merged_size = request_headers.size() + request_body->size(); 971 size_t merged_size = request_headers.size() + request_body->size();
972 if (merged_size <= kMaxMergedHeaderAndBodySize) 972 if (merged_size <= kMaxMergedHeaderAndBodySize)
973 return true; 973 return true;
974 } 974 }
975 return false; 975 return false;
976 } 976 }
977 977
978 } // namespace net 978 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698