Fixed OnDataAvailable(...) to abort the stream if it returns a failure code...
git-svn-id: svn://10.0.0.236/trunk@7929 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
1674edc74a
commit
246f5b3065
@ -556,7 +556,7 @@ nsresult nsBlockingStream::Write(const char *aBuf,
|
||||
PRInt32 *aWriteCount)
|
||||
{
|
||||
PRInt32 bytesFree;
|
||||
nsresult rv;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
LockStream();
|
||||
|
||||
|
||||
@ -560,7 +560,11 @@ int stub_put_block(NET_StreamClass *stream, const char *buffer, int32 length)
|
||||
errorCode = pConn->pConsumer->OnDataAvailable(pConn->pURL, pConn->pNetStream, bytesWritten);
|
||||
}
|
||||
|
||||
return ((NS_OK == errorCode) && (bytesWritten == length));
|
||||
/* Abort the connection if an error occurred... */
|
||||
if (NS_FAILED(errorCode) || (bytesWritten != length)) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned int stub_is_write_ready(NET_StreamClass *stream)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user