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

Unified Diff: content/browser/download/download_request_core.cc

Issue 2092523002: Remove hack to treat ERR_INCOMPLETE_CHUNKED_ENCODING error as success. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_request_core.cc
diff --git a/content/browser/download/download_request_core.cc b/content/browser/download/download_request_core.cc
index 4ab373f18777cecc9e65036af70d61d4fa21a69a..5ef50a12b147f6dbdea86e6627788d7591a77273 100644
--- a/content/browser/download/download_request_core.cc
+++ b/content/browser/download/download_request_core.cc
@@ -523,23 +523,19 @@ std::string DownloadRequestCore::DebugString() const {
DownloadInterruptReason DownloadRequestCore::HandleRequestStatus(
const net::URLRequestStatus& status) {
net::Error error_code = net::OK;
- if (status.status() == net::URLRequestStatus::FAILED ||
- // Note cancels as failures too.
- status.status() == net::URLRequestStatus::CANCELED) {
+ if (!status.is_success()) {
error_code = static_cast<net::Error>(status.error()); // Normal case.
// Make sure that at least the fact of failure comes through.
if (error_code == net::OK)
error_code = net::ERR_FAILED;
}
- // ERR_CONTENT_LENGTH_MISMATCH and ERR_INCOMPLETE_CHUNKED_ENCODING are
- // allowed since a number of servers in the wild close the connection too
- // early by mistake. Other browsers - IE9, Firefox 11.0, and Safari 5.1.4 -
- // treat downloads as complete in both cases, so we follow their lead.
- if (error_code == net::ERR_CONTENT_LENGTH_MISMATCH ||
- error_code == net::ERR_INCOMPLETE_CHUNKED_ENCODING) {
+ // ERR_CONTENT_LENGTH_MISMATCH is allowed since a number of servers in the
+ // wild close the connection too early by mistake. Other browsers - IE9,
+ // Firefox 11.0, and Safari 5.1.4 - treat downloads as complete in both cases,
+ // so we follow their lead.
+ if (error_code == net::ERR_CONTENT_LENGTH_MISMATCH)
error_code = net::OK;
- }
DownloadInterruptReason reason = ConvertNetErrorToInterruptReason(
error_code, DOWNLOAD_INTERRUPT_FROM_NETWORK);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698