mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 09:15:35 +00:00
fix for bug 25360, need to check channel for errors. r=pnunn
This commit is contained in:
parent
4e8cbc7f5d
commit
d7eb8e76a0
@ -46,6 +46,7 @@
|
||||
|
||||
#include "nsCURILoader.h"
|
||||
#include "nsIURIContentListener.h"
|
||||
#include "nsIHTTPChannel.h"
|
||||
|
||||
static NS_DEFINE_IID(kIImageNetContextIID, IL_INETCONTEXT_IID);
|
||||
static NS_DEFINE_IID(kIURLIID, NS_IURL_IID);
|
||||
@ -246,6 +247,7 @@ ImageConsumer::DoContent(const char * aContentType,
|
||||
NS_IMETHODIMP
|
||||
ImageConsumer::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
|
||||
{
|
||||
PRUint32 httpStatus;
|
||||
if (mInterrupted) {
|
||||
mStatus = MK_INTERRUPTED;
|
||||
return NS_ERROR_ABORT;
|
||||
@ -257,6 +259,15 @@ ImageConsumer::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
|
||||
return NS_ERROR_ABORT;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIHTTPChannel> pHTTPCon(do_QueryInterface(channel));
|
||||
if (pHTTPCon) {
|
||||
pHTTPCon->GetResponseStatus(&httpStatus);
|
||||
if (httpStatus == 404) {
|
||||
mStatus = MK_IMAGE_LOSSAGE;
|
||||
return NS_ERROR_ABORT;
|
||||
}
|
||||
}
|
||||
|
||||
ilINetReader *reader = mURL->GetReader(); //ptn test: nsCOMPtr??
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user