| Index: chrome/browser/download/download_manager.cc
|
| diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
|
| index 0ba403a8faa227d9373de462a92bdd5b076480f6..1988751dab8c03b12763ea357fba1e0b4d45f1e4 100644
|
| --- a/chrome/browser/download/download_manager.cc
|
| +++ b/chrome/browser/download/download_manager.cc
|
| @@ -632,7 +632,12 @@ void DownloadManager::OnResponseCompleted(int32 download_id,
|
| int os_error,
|
| const std::string& hash) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - if (os_error == 0) {
|
| + // ERR_CONNECTION_CLOSED is allowed since a number of servers in the wild
|
| + // advertise a larger Content-Length than the amount of bytes in the message
|
| + // body, and then close the connection. Other browsers - IE8, Firefox 4.0.1,
|
| + // and Safari 5.0.4 - treat the download as complete in this case, so we
|
| + // follow their lead.
|
| + if (os_error == 0 || os_error == net::ERR_CONNECTION_CLOSED) {
|
| OnAllDataSaved(download_id, size, hash);
|
| } else {
|
| OnDownloadError(download_id, size, os_error);
|
|
|