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); |