Bug 927291 - Fix system has no response if sdcard is full during download. r=jduell
authorkli@mozilla.com
Tue, 22 Oct 2013 11:22:57 +0800
changeset 166056 c1ecd3ac0f716fe7999b0beea9a3c7adb07b2a8d
parent 166055 30d696088b00d44f2867ecd8ffe60b28d8ddf16c
child 166057 2d6c5cbcc2138976abce2b1431ad893c9c3f0f08
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs927291
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 927291 - Fix system has no response if sdcard is full during download. r=jduell
netwerk/base/src/nsIncrementalDownload.cpp
--- a/netwerk/base/src/nsIncrementalDownload.cpp
+++ b/netwerk/base/src/nsIncrementalDownload.cpp
@@ -758,18 +758,21 @@ nsIncrementalDownload::OnDataAvailable(n
     if (NS_FAILED(rv))
       return rv;
     if (n != len)
       return NS_ERROR_UNEXPECTED;
 
     count -= n;
     mChunkLen += n;
 
-    if (mChunkLen == mChunkSize)
-      FlushChunk();
+    if (mChunkLen == mChunkSize) {
+      rv = FlushChunk();
+      if (NS_FAILED(rv))
+        return rv;
+    }
   }
 
   if (PR_Now() > mLastProgressUpdate + UPDATE_PROGRESS_INTERVAL)
     UpdateProgress();
 
   return NS_OK;
 }