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

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

Issue 2794683002: set content length limit if half open range request fails (Closed)
Patch Set: Created 3 years, 9 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
Index: content/browser/download/parallel_download_job.cc
diff --git a/content/browser/download/parallel_download_job.cc b/content/browser/download/parallel_download_job.cc
index 6785faad990ea89293e5f8dc1ccda803a4e66e01..6f844d16353e39cab0196761ff3416c032fa441c 100644
--- a/content/browser/download/parallel_download_job.cc
+++ b/content/browser/download/parallel_download_job.cc
@@ -117,6 +117,12 @@ void ParallelDownloadJob::OnServerResponseError(
// TODO(xingliu): Consider to let the original request to cover the full
// content if the sub-requests get invalid response. Consider retry on certain
// error.
+ if (worker->length() == DownloadSaveInfo::kLengthFullContent &&
+ reason ==
+ DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE) {
+ SetContentLengthLimit(worker->offset());
+ return;
+ }
DownloadJob::Interrupt(reason);
}

Powered by Google App Engine
This is Rietveld 408576698