diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-08 04:31:37 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-08 04:31:37 +0000 |
commit | f001bd6a14612d0d547539c5a7a3cf53f95e3816 (patch) | |
tree | c072c54a7a841b24256343443ec0f1ffac384cd1 /webkit | |
parent | f508e4e37229721672f9f567b856986859ff323c (diff) | |
download | chromium_src-f001bd6a14612d0d547539c5a7a3cf53f95e3816.zip chromium_src-f001bd6a14612d0d547539c5a7a3cf53f95e3816.tar.gz chromium_src-f001bd6a14612d0d547539c5a7a3cf53f95e3816.tar.bz2 |
Revert 110505 - 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
Review URL: http://codereview.chromium.org/8496016
TBR=cbentzel@chromium.org
Review URL: http://codereview.chromium.org/8863002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/weburlloader_impl.cc | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc index de470c4..7df6ace 100644 --- a/webkit/glue/weburlloader_impl.cc +++ b/webkit/glue/weburlloader_impl.cc @@ -608,7 +608,7 @@ void WebURLLoaderImpl::Context::OnReceivedCachedMetadata( } void WebURLLoaderImpl::Context::OnCompletedRequest( - const net::URLRequestStatus& original_status, + const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { if (ftp_listing_delegate_.get()) { @@ -619,16 +619,6 @@ void WebURLLoaderImpl::Context::OnCompletedRequest( multipart_delegate_.reset(NULL); } - net::URLRequestStatus status = original_status; - - // Rewrite the Content-Length mismatch as a success. - // See crbug.com/52847 for justification. - if (status.status() != net::URLRequestStatus::SUCCESS && - status.error() == net::ERR_CONTENT_LENGTH_MISMATCH) { - status.set_status(net::URLRequestStatus::SUCCESS); - status.set_error(net::OK); - } - // Prevent any further IPC to the browser now that we're complete, but // don't delete it to keep any downloaded temp files alive. DCHECK(!completed_bridge_.get()); |