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:
rpotts%netscape.com 1998-08-13 08:19:49 +00:00
parent 1674edc74a
commit 246f5b3065
2 changed files with 6 additions and 2 deletions

View File

@ -556,7 +556,7 @@ nsresult nsBlockingStream::Write(const char *aBuf,
PRInt32 *aWriteCount)
{
PRInt32 bytesFree;
nsresult rv;
nsresult rv = NS_OK;
LockStream();

View File

@ -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)