Bug 897904 - Set nsInputStreamPump::mStatus only if EnsureWaiting fails

This commit is contained in:
Steve Workman 2013-08-12 11:13:23 -07:00
parent c757e84c26
commit 05f8d03829

View File

@ -425,11 +425,15 @@ nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *stream)
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;
}