Commit 42d48e6c authored by Min Qin's avatar Min Qin Committed by Commit Bot

Always resume download for CONTENT_LENGTH_MISMATCH errors

When strong validators are not present, we don't resume download if
CONTENT_LENGTH_MISMATCH error happens.
However, according to UMA, more than 99% of the cases more data will
be received after a CONTENT_LENGTH_MISMATCH error if strong validators
are present. And since we are launching the feature to allow download
resumption without strong validators, many of these interrupted
downloads can now resume.

BUG=1002591

Change-Id: I75facafef994e6c4637e52b340dddc05fca94833
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1795761Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695375}
parent 33bbb6b3
...@@ -57,23 +57,6 @@ DownloadInterruptReason HandleRequestCompletionStatus( ...@@ -57,23 +57,6 @@ DownloadInterruptReason HandleRequestCompletionStatus(
net::CertStatus cert_status, net::CertStatus cert_status,
bool is_partial_request, bool is_partial_request,
DownloadInterruptReason abort_reason) { DownloadInterruptReason abort_reason) {
// ERR_CONTENT_LENGTH_MISMATCH can be caused by 1 of the following reasons:
// 1. Server or proxy closes the connection too early.
// 2. The content-length header is wrong.
// If the download has strong validators, we can interrupt the download
// and let it resume automatically. Otherwise, resuming the download will
// cause it to restart and the download may never complete if the error was
// caused by reason 2. As a result, downloads without strong validators are
// treated as completed here.
// TODO(qinmin): check the metrics from downloads with strong validators,
// and decide whether we should interrupt downloads without strong validators
// rather than complete them.
if (error_code == net::ERR_CONTENT_LENGTH_MISMATCH &&
!has_strong_validators) {
error_code = net::OK;
RecordDownloadCount(COMPLETED_WITH_CONTENT_LENGTH_MISMATCH_COUNT);
}
if (error_code == net::ERR_ABORTED) { if (error_code == net::ERR_ABORTED) {
// ERR_ABORTED == something outside of the network // ERR_ABORTED == something outside of the network
// stack cancelled the request. There aren't that many things that // stack cancelled the request. There aren't that many things that
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment