diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 16:24:48 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 16:24:48 +0000 |
commit | ea5419c73993e55df8f3aaade121de31f1ea6ab9 (patch) | |
tree | f0c6496dbaf55fb163921cd6061152b10aa4b75b /net/base | |
parent | 211d9703e8237deb4a6d34f2bd07f5680f791846 (diff) | |
download | chromium_src-ea5419c73993e55df8f3aaade121de31f1ea6ab9.zip chromium_src-ea5419c73993e55df8f3aaade121de31f1ea6ab9.tar.gz chromium_src-ea5419c73993e55df8f3aaade121de31f1ea6ab9.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110505 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/net_error_list.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h index 2f96f86..430d7ae 100644 --- a/net/base/net_error_list.h +++ b/net/base/net_error_list.h @@ -511,6 +511,9 @@ NET_ERROR(SPDY_SERVER_REFUSED_STREAM, -351) // SPDY server didn't respond to the PING message. NET_ERROR(SPDY_PING_FAILED, -352) +// Content-Length does not match the number of bytes received. +NET_ERROR(CONTENT_LENGTH_MISMATCH, -353) + // The cache does not have the requested entry. NET_ERROR(CACHE_MISS, -400) |