зеркало из https://github.com/mozilla/gecko-dev.git
Fixed OnDataAvailable(...) to abort the stream if it returns a failure code...
This commit is contained in:
Родитель
10b4d2e0e9
Коммит
ca2c7d9353
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче