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

Unified Diff: chrome/browser/download/download_manager.cc

Issue 6881106: Treat ERR_CONNECTION_CLOSED as end-of-data marker for downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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: chrome/browser/download/download_manager.cc
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index ccedecf5b5fdb06bcc85c8de983d92fdd149367f..2c28f5cdcc4355de74d7dde35281c821dfd11310 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -539,7 +539,12 @@ void DownloadManager::OnResponseCompleted(int32 download_id,
int os_error,
const std::string& hash) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (os_error == 0) {
+ // Some web sites lie about the size of the data (for example, using gzip
+ // encoding and specifying the size of the expanded data) and disconnect
+ // when the data is done. Unfortunately, this means that if we get a
+ // disconnect and the data hasn't been completely downloaded we can't tell.
+ // See http://code.google.com/p/chromium/issues/detail?id=78769.
+ if ((os_error == 0) || (os_error == net::ERR_CONNECTION_CLOSED)) {
cbentzel 2011/04/21 17:16:41 We discussed doing this at a lower-layer [in HttpS
OnAllDataSaved(download_id, size, hash);
} else {
OnDownloadError(download_id, size, os_error);
« 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