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

Issue 8496016: Report ERR_CONTENT_LENGTH_MISMATCH when the count of bytes received doesn't match Content-Length. (Closed)

Created:
9 years, 1 month ago by cbentzel
Modified:
9 years, 1 month ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, jam, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, rdsmith+dwatch_chromium.org, Paweł Hajdan Jr., mmenke
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Report ERR_CONTENT_LENGTH_MISMATCH when the count of bytes received doesn't match Content-Length. This used to be reported as ERR_CONNECTION_CLOSED. Unfortunately, there are a number of misconfigured servers on the web which report a Content-Length completely divorced from reality. Other browsers display whatever data was received without reporting errors in this case, and Chrome now does the same. An earlier CL simply removed error reporting for this case. However, some uses may want to still treat this like an error (such as URLFetcher), or could eventually treat the case as an error and recover (such as downloads). Data received will be populated in the disk cache as a truncated entry, if the server advertises byte range support. WebURLLoaderImpl ignores this for all async and sync resource loads. At some point it may want to selectively do this based on content type. Downloads ignore the error, but no longer ignore ERR_CONNECTION_CLOSED. Other uses will treat this like an error. BUG=52847 TEST=Manually, go to a site that advertises a large content-length and closes the connection before writing so many bytes, and notice that the page now displays. Automatic: HttpNetworkTransactionTest.LargeContentLengthThenClose, URLRequestTestHttp.GetZippedTest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110505

Patch Set 1 #

Patch Set 2 : Restrict to async loader only #

Patch Set 3 : Fix sync case #

Total comments: 6

Patch Set 4 : Chunked encoding, test fix #

Total comments: 2

Patch Set 5 : Improve comment #

Total comments: 2

Patch Set 6 : Clear error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -51 lines) Patch
M content/browser/download/download_resource_handler.cc View 1 chunk +6 lines, -6 lines 0 comments Download
M net/base/net_error_list.h View 1 chunk +3 lines, -0 lines 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_stream_parser.cc View 1 2 3 4 1 chunk +32 lines, -6 lines 0 comments Download
M net/url_request/url_request_http_job.h View 1 chunk +0 lines, -7 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 3 chunks +0 lines, -28 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M webkit/glue/weburlloader_impl.cc View 1 2 3 4 5 2 chunks +11 lines, -1 line 0 comments Download

Messages

Total messages: 15 (0 generated)
cbentzel
ahendrickson: review the download change, and url_request_http_job. darin: review weburlloader_impl.cc rvargas: The whole thing. I ...
9 years, 1 month ago (2011-11-08 22:29:51 UTC) #1
ahendrickson
LGTM.
9 years, 1 month ago (2011-11-08 23:13:21 UTC) #2
rvargas (doing something else)
http://codereview.chromium.org/8496016/diff/3009/net/http/http_stream_parser.cc File net/http/http_stream_parser.cc (right): http://codereview.chromium.org/8496016/diff/3009/net/http/http_stream_parser.cc#newcode537 net/http/http_stream_parser.cc:537: if (result == 0 && !IsResponseBodyComplete() && CanFindEndOfResponse()) This ...
9 years, 1 month ago (2011-11-08 23:27:46 UTC) #3
darin (slow to review)
http://codereview.chromium.org/8496016/diff/3009/webkit/glue/weburlloader_impl.cc File webkit/glue/weburlloader_impl.cc (right): http://codereview.chromium.org/8496016/diff/3009/webkit/glue/weburlloader_impl.cc#newcode606 webkit/glue/weburlloader_impl.cc:606: net::URLRequestStatus status = original_status; what's the justification for doing ...
9 years, 1 month ago (2011-11-08 23:30:53 UTC) #4
cbentzel
http://codereview.chromium.org/8496016/diff/3009/net/http/http_stream_parser.cc File net/http/http_stream_parser.cc (right): http://codereview.chromium.org/8496016/diff/3009/net/http/http_stream_parser.cc#newcode537 net/http/http_stream_parser.cc:537: if (result == 0 && !IsResponseBodyComplete() && CanFindEndOfResponse()) On ...
9 years, 1 month ago (2011-11-09 01:26:09 UTC) #5
cbentzel
http://codereview.chromium.org/8496016/diff/3009/net/http/http_stream_parser.cc File net/http/http_stream_parser.cc (right): http://codereview.chromium.org/8496016/diff/3009/net/http/http_stream_parser.cc#newcode537 net/http/http_stream_parser.cc:537: if (result == 0 && !IsResponseBodyComplete() && CanFindEndOfResponse()) On ...
9 years, 1 month ago (2011-11-09 18:17:36 UTC) #6
cbentzel
http://codereview.chromium.org/8496016/diff/3009/net/http/http_stream_parser.cc File net/http/http_stream_parser.cc (right): http://codereview.chromium.org/8496016/diff/3009/net/http/http_stream_parser.cc#newcode537 net/http/http_stream_parser.cc:537: if (result == 0 && !IsResponseBodyComplete() && CanFindEndOfResponse()) On ...
9 years, 1 month ago (2011-11-09 18:48:35 UTC) #7
rvargas (doing something else)
LGTM as long as Darin is happy with the location of the fixup. http://codereview.chromium.org/8496016/diff/6002/net/http/http_stream_parser.cc File ...
9 years, 1 month ago (2011-11-09 19:55:26 UTC) #8
cbentzel
http://codereview.chromium.org/8496016/diff/6002/net/http/http_stream_parser.cc File net/http/http_stream_parser.cc (right): http://codereview.chromium.org/8496016/diff/6002/net/http/http_stream_parser.cc#newcode539 net/http/http_stream_parser.cc:539: result = ERR_INVALID_CHUNKED_ENCODING; On 2011/11/09 19:55:26, rvargas wrote: > ...
9 years, 1 month ago (2011-11-09 20:40:53 UTC) #9
cbentzel
darin: ping
9 years, 1 month ago (2011-11-14 15:41:38 UTC) #10
darin (slow to review)
http://codereview.chromium.org/8496016/diff/8002/webkit/glue/weburlloader_impl.cc File webkit/glue/weburlloader_impl.cc (right): http://codereview.chromium.org/8496016/diff/8002/webkit/glue/weburlloader_impl.cc#newcode612 webkit/glue/weburlloader_impl.cc:612: status.set_status(net::URLRequestStatus::SUCCESS); should you also clear the error field here ...
9 years, 1 month ago (2011-11-16 21:59:57 UTC) #11
cbentzel
http://codereview.chromium.org/8496016/diff/8002/webkit/glue/weburlloader_impl.cc File webkit/glue/weburlloader_impl.cc (right): http://codereview.chromium.org/8496016/diff/8002/webkit/glue/weburlloader_impl.cc#newcode612 webkit/glue/weburlloader_impl.cc:612: status.set_status(net::URLRequestStatus::SUCCESS); On 2011/11/16 21:59:57, darin wrote: > should you ...
9 years, 1 month ago (2011-11-16 22:19:28 UTC) #12
darin (slow to review)
On Wed, Nov 16, 2011 at 2:19 PM, <cbentzel@chromium.org> wrote: > > http://codereview.chromium.**org/8496016/diff/8002/webkit/** > glue/weburlloader_impl.cc<http://codereview.chromium.org/8496016/diff/8002/webkit/glue/weburlloader_impl.cc> ...
9 years, 1 month ago (2011-11-17 05:05:03 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cbentzel@chromium.org/8496016/12002
9 years, 1 month ago (2011-11-17 14:43:19 UTC) #14
commit-bot: I haz the power
9 years, 1 month ago (2011-11-17 16:24:50 UTC) #15
Change committed as 110505

Powered by Google App Engine
This is Rietveld 408576698