This commit is contained in:
pnunn%netscape.com 1999-08-09 21:25:39 +00:00
Родитель 844cc21667
Коммит 9b5314bc61
1 изменённых файлов: 12 добавлений и 5 удалений

Просмотреть файл

@ -246,6 +246,7 @@ ImageConsumer::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32
PRUint32 max_read; PRUint32 max_read;
PRUint32 bytes_read = 0, str_length; PRUint32 bytes_read = 0, str_length;
ilINetReader *reader = mURL->GetReader(); ilINetReader *reader = mURL->GetReader();
PRInt32 ilErr;
if (mInterrupted || mStatus != 0) { if (mInterrupted || mStatus != 0) {
mStatus = MK_INTERRUPTED; mStatus = MK_INTERRUPTED;
@ -298,7 +299,13 @@ ImageConsumer::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32
} }
} }
reader->Write((const unsigned char *)mBuffer, (int32)nb); ilErr = reader->Write((const unsigned char *)mBuffer, (int32)nb);
if(ilErr <= 0){
mStatus = MK_IMAGE_LOSSAGE;
mInterrupted = PR_TRUE;
NS_RELEASE(reader);
return NS_ERROR_ABORT;
}
} while(nb != 0); } while(nb != 0);
if ((NS_OK != err) && (NS_BASE_STREAM_EOF != err)) { if ((NS_OK != err) && (NS_BASE_STREAM_EOF != err)) {
@ -576,9 +583,9 @@ ImageNetContextImpl::GetURL (ilIURL * aURL,
if (aURL->QueryInterface(kIURLIID, (void **)&nsurl) == NS_OK) { if (aURL->QueryInterface(kIURLIID, (void **)&nsurl) == NS_OK) {
aURL->SetReader(aReader); aURL->SetReader(aReader);
// Find previously created ImageConsumer if possible
SetReloadPolicy(aLoadMethod); SetReloadPolicy(aLoadMethod);
// Find previously created ImageConsumer if possible
ImageConsumer *ic = new ImageConsumer(aURL, this); ImageConsumer *ic = new ImageConsumer(aURL, this);
NS_ADDREF(ic); NS_ADDREF(ic);