Bug 1305025 - Don't return error from nsPipe::Status when there are data to read to prevent potentiall loop. r=jduell

--HG--
extra : rebase_source : 8362d5f7e6a459d507ba8b7ac8a74afed9242982
This commit is contained in:
Honza Bambas 2016-09-28 03:32:00 -04:00
parent 63caea8af6
commit eeb66ca287

View File

@ -1525,7 +1525,18 @@ nsPipeInputStream::Clone(nsIInputStream** aCloneOut)
nsresult
nsPipeInputStream::Status(const ReentrantMonitorAutoEnter& ev) const
{
return NS_FAILED(mInputStatus) ? mInputStatus : mPipe->mStatus;
if (NS_FAILED(mInputStatus)) {
return mInputStatus;
}
if (mReadState.mAvailable) {
// Still something to read and this input stream state is OK.
return NS_OK;
}
// Nothing to read, just fall through to the pipe's state that
// may reflect state of its output stream side (already closed).
return mPipe->mStatus;
}
nsresult