Bug 897904 - Set nsInputStreamPump::mStatus only if EnsureWaiting fails r=jduell a=akeybl
authorSteve Workman <sworkman@mozilla.com>
Mon, 12 Aug 2013 11:13:23 -0700
changeset 153833 837d42da0c32ddf06843af2136f5ee4c68212395
parent 153832 142b288d365f533a898c814801398fd362f9e6c4
child 153834 457495c9e1cf85e86dbb341894613b3704f8c700
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell, akeybl
bugs897904
milestone25.0a2
Bug 897904 - Set nsInputStreamPump::mStatus only if EnsureWaiting fails r=jduell a=akeybl
netwerk/base/src/nsInputStreamPump.cpp
--- a/netwerk/base/src/nsInputStreamPump.cpp
+++ b/netwerk/base/src/nsInputStreamPump.cpp
@@ -420,21 +420,25 @@ nsInputStreamPump::OnInputStreamReady(ns
             mRetargeting = true;
         }
 
         // Wait asynchronously if there is still data to transfer, or we're
         // switching event delivery to another thread.
         if (!mSuspendCount && (stillTransferring || mRetargeting)) {
             mState = nextState;
             mWaiting = false;
-            mStatus = EnsureWaiting();
-            if (NS_SUCCEEDED(mStatus))
+            nsresult rv = EnsureWaiting();
+            if (NS_SUCCEEDED(rv))
                 break;
             
             // Failure to start asynchronous wait: stop transfer.
+            // Do not set mStatus if it was previously set to report a failure.
+            if (NS_SUCCEEDED(mStatus)) {
+                mStatus = rv;
+            }
             nextState = STATE_STOP;
         }
 
         mState = nextState;
     }
     return NS_OK;
 }