}  nsCOMPtr<nsIHTTPChannel> pHTTPCon(do_QueryInterface(channel)); if (pHTTPCon) { pHTTPCon->GetResponseStatus(&httpStatus); if (httpStatus == 404) { mStatus = MK_IMAGE_LOSSAGE; return NS_ERROR_ABORT; }
ImageConsumer::OnStartRequest(nsIChannel* channel, nsISupports* aContext){  if (mInterrupted) {    mStatus = MK_INTERRUPTED;    return NS_ERROR_ABORT;  }  mBuffer = (char *)PR_MALLOC(IMAGE_BUF_SIZE);  if (mBuffer == nsnull) {    mStatus = MK_IMAGE_LOSSAGE;    return NS_ERROR_ABORT;  }  ilINetReader *reader = mURL->GetReader(); //ptn test: nsCOMPtr??  nsresult rv = NS_OK;  char* aContentType = NULL;  rv = channel->GetContentType(&aContentType); //nsCRT alloc's str  if (NS_FAILED(rv)) {      if(aContentType){          nsCRT::free(aContentType);      }      aContentType = nsCRT::strdup("unknown");          }  if(nsCRT::strlen(aContentType) > 50){      //somethings wrong. mimetype string shouldn't be this big.      //protect us from the user.      nsCRT::free(aContentType);      aContentType = nsCRT::strdup("unknown");   }  if (reader->StreamCreated(mURL, aContentType) != PR_TRUE) {    mStatus = MK_IMAGE_LOSSAGE;    reader->StreamAbort(mStatus);    NS_RELEASE(reader);    nsCRT::free(aContentType);    return NS_ERROR_ABORT;  }  nsCRT::free(aContentType);  NS_RELEASE(reader);      return NS_OK;}