Remove buffer size sanity check from URLRequestJob::Read |
||||
Issue descriptionThe current DCHECK_LT(buf_size, 1000000) in URLRequestJob::Read() prevents client from passing a buffer greater than 1MB. In some cases, the client may want to allocate enough space to fit the whole response data into a single uninterrupted buffers, which size is equal to the value of the content-length header. Breaking the buffer into multiple parts and then coalescing them imposes the performance penalty. Making multiple calls and moving the buffer position/limit defeats the purpose and introduces code complexity. Some context: https://groups.google.com/a/chromium.org/forum/#!topic/net-dev/eDh3xb3kn5Q Internal bug: http://b/37406581
,
Apr 19 2017
That is a good point. It is also the matter of convenience. If a client expects some content, let's say, 2MB long. It is much easier to allocate a single direct 2MB buffer and reuse it until it fills up, rather than creating multiple buffers or setting an artificial limit on the buffer. If the client underestimated the size, a new buffer can be created. I think the DCHECK made sense for the internal sanity check but since the buffer is exposed to the client, we should not enforce some arbitrary size.
,
Apr 20 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2375f72a0c62be56a6cb80fd2daff66c7748fda4 commit 2375f72a0c62be56a6cb80fd2daff66c7748fda4 Author: kapishnikov <kapishnikov@chromium.org> Date: Thu Apr 20 03:12:42 2017 Remove buffer size sanity check from URLRequestJob::Read BUG= 713358 Review-Url: https://codereview.chromium.org/2829833002 Cr-Commit-Position: refs/heads/master@{#465881} [modify] https://crrev.com/2375f72a0c62be56a6cb80fd2daff66c7748fda4/net/url_request/url_request_job.cc
,
Apr 20 2017
,
Jul 6
,
Jul 6
|
||||
►
Sign in to add a comment |
||||
Comment 1 by mmenke@chromium.org
, Apr 19 2017