mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
Fixed up socket transport to abort the operation if the consumer OnDataAvailable(...) returns a failure...
This commit is contained in:
parent
94f842b81e
commit
3eac314475
@ -294,9 +294,12 @@ nsAsyncStreamObserver::OnStopBinding(nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
nsresult rv = GetStatus();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsresult rv;
|
||||
|
||||
//
|
||||
// The OnStopBindiong event should always be fired, so do not
|
||||
// check the status...
|
||||
//
|
||||
nsOnStopBindingEvent* event =
|
||||
new nsOnStopBindingEvent(this, context);
|
||||
if (event == nsnull)
|
||||
|
@ -729,8 +729,16 @@ nsresult nsSocketTransport::doRead(PRInt16 aSelectFlags)
|
||||
// been filled into the stream as possible...
|
||||
//
|
||||
if (totalBytesWritten && mReadListener) {
|
||||
mReadListener->OnDataAvailable(mReadContext, mReadStream, mSourceOffset,
|
||||
totalBytesWritten);
|
||||
nsresult rv1;
|
||||
|
||||
rv1 = mReadListener->OnDataAvailable(mReadContext, mReadStream, mSourceOffset,
|
||||
totalBytesWritten);
|
||||
//
|
||||
// If the consumer returns failure, then cancel the operation...
|
||||
//
|
||||
if (NS_FAILED(rv1)) {
|
||||
rv = rv1;
|
||||
}
|
||||
mSourceOffset += totalBytesWritten;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user