mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1818305 - Part 3: Check streamStatus from nsAStreamCopier, r=xpcom-reviewers,mccr8
This will ensure that errors in one side of a NS_AsyncCopy will more reliably propagate to the other side of the NS_AsyncCopy, by allowing us to check for situations like stream closure reliably even when the other side either has no available data, or no available space. Differential Revision: https://phabricator.services.mozilla.com/D170698
This commit is contained in:
parent
3b40268cc1
commit
ff7f4f17f4
@ -530,7 +530,9 @@ class nsStreamCopierIB final : public nsAStreamCopier {
|
||||
uint32_t n;
|
||||
*aSourceCondition =
|
||||
mSource->ReadSegments(ConsumeInputBuffer, &state, mChunkSize, &n);
|
||||
*aSinkCondition = state.mSinkCondition;
|
||||
*aSinkCondition = NS_SUCCEEDED(state.mSinkCondition) && n == 0
|
||||
? mSink->StreamStatus()
|
||||
: state.mSinkCondition;
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -572,7 +574,9 @@ class nsStreamCopierOB final : public nsAStreamCopier {
|
||||
uint32_t n;
|
||||
*aSinkCondition =
|
||||
mSink->WriteSegments(FillOutputBuffer, &state, mChunkSize, &n);
|
||||
*aSourceCondition = state.mSourceCondition;
|
||||
*aSourceCondition = NS_SUCCEEDED(state.mSourceCondition) && n == 0
|
||||
? mSource->StreamStatus()
|
||||
: state.mSourceCondition;
|
||||
return n;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user