diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 22:28:26 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 22:28:26 +0000 |
commit | c03d02a85e06cbb3a2ef60c87c64abda8902bbf6 (patch) | |
tree | 807a8874b1c2571607999876611b1315cd209bc3 /net | |
parent | c91febb8b30b144e1742e1a9879fba95b326af62 (diff) | |
download | chromium_src-c03d02a85e06cbb3a2ef60c87c64abda8902bbf6.zip chromium_src-c03d02a85e06cbb3a2ef60c87c64abda8902bbf6.tar.gz chromium_src-c03d02a85e06cbb3a2ef60c87c64abda8902bbf6.tar.bz2 |
Increase the maximum allowed read buffer to 2MB.
BUG=28670
TEST=DevToolsSanityTest
Review URL: http://codereview.chromium.org/435015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_stream.h | 2 | ||||
-rw-r--r-- | net/http/http_stream_parser.cc | 4 | ||||
-rw-r--r-- | net/http/http_stream_parser.h | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/net/http/http_stream.h b/net/http/http_stream.h index 329db5a..b13bb6f 100644 --- a/net/http/http_stream.h +++ b/net/http/http_stream.h @@ -51,7 +51,7 @@ class HttpStream { virtual HttpResponseInfo* GetResponseInfo() const = 0; // Reads response body data, up to |buf_len| bytes. |buf_len| should be a - // reasonable size (<256KB). The number of bytes read is returned, or an + // reasonable size (<2MB). The number of bytes read is returned, or an // error is returned upon failure. ERR_CONNECTION_CLOSED is returned to // indicate end-of-connection. ERR_IO_PENDING is returned if the operation // could not be completed synchronously, in which case the result will be diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc index 24f4879..6ad29ae 100644 --- a/net/http/http_stream_parser.cc +++ b/net/http/http_stream_parser.cc @@ -84,7 +84,7 @@ int HttpStreamParser::ReadResponseBody(IOBuffer* buf, int buf_len, DCHECK(io_state_ == STATE_BODY_PENDING || io_state_ == STATE_DONE); DCHECK(!user_callback_); DCHECK(callback); - DCHECK_LE(buf_len, kMaxHeaderBufSize); + DCHECK_LE(buf_len, kMaxBufSize); if (io_state_ == STATE_DONE) return OK; @@ -382,7 +382,7 @@ int HttpStreamParser::DoReadBodyComplete(int result) { } } - CHECK(save_amount + additional_save_amount <= kMaxHeaderBufSize); + CHECK(save_amount + additional_save_amount <= kMaxBufSize); if (read_buf_->capacity() < save_amount + additional_save_amount) { read_buf_->SetCapacity(save_amount + additional_save_amount); } diff --git a/net/http/http_stream_parser.h b/net/http/http_stream_parser.h index 012039f..f2108a9 100644 --- a/net/http/http_stream_parser.h +++ b/net/http/http_stream_parser.h @@ -76,6 +76,9 @@ class HttpStreamParser { // Note: |kMaxHeaderBufSize| should be a multiple of |kHeaderBufInitialSize|. enum { kMaxHeaderBufSize = 256 * 1024 }; // 256 kilobytes. + // The maximum sane buffer size. + enum { kMaxBufSize = 2 * 1024 * 1024 }; // 2 megabytes. + // Handle callbacks. void OnIOComplete(int result); |