зеркало из https://github.com/mozilla/gecko-dev.git
if no more data is available when reading a non-blocking input stream then return either WOULD_BLOCK or NS_OK... But exit the loop to prevent spinning!
This commit is contained in:
Родитель
05b81531f8
Коммит
40e0f4af98
|
@ -174,6 +174,10 @@ nsBufferInputStream::Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount)
|
|||
if (amt == 0) {
|
||||
rv = Fill();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (!mBlocking) {
|
||||
// Only return WOULD_BLOCK if no data was read...
|
||||
return *aReadCount > 0 ? NS_OK : rv;
|
||||
}
|
||||
}
|
||||
else {
|
||||
*aReadCount += amt;
|
||||
|
|
Загрузка…
Ссылка в новой задаче