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 167008 c1ecd3ac0f716fe7999b0beea9a3c7adb07b2a8d
parent 167007 30d696088b00d44f2867ecd8ffe60b28d8ddf16c
child 167009 2d6c5cbcc2138976abce2b1431ad893c9c3f0f08
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [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;
 }