image_url = mime_set_url_part(obj->options->url, part, PR_TRUE);
char *no_part_url = nsnull; if (obj->options->part_to_load && obj->options->format_out == nsMimeOutput::nsMimeMessageBodyDisplay) no_part_url = mime_get_base_url(obj->options->url);  if (no_part_url) { image_url = mime_set_url_part(no_part_url, part, PR_TRUE); PR_Free(no_part_url); } else image_url = mime_set_url_part(obj->options->url, part, PR_TRUE);
MimeInlineImage_parse_begin (MimeObject *obj){  MimeInlineImage *img = (MimeInlineImage *) obj;  MimeInlineImageClass *clazz;  int status;  status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_begin(obj);  if (status < 0) return status;  if (!obj->output_p) return 0;  if (!obj->options || !obj->options->output_fn)    return 0;  clazz = (MimeInlineImageClass *) obj->clazz;  if (obj->options &&    obj->options->image_begin &&    obj->options->write_html_p &&    obj->options->image_write_buffer)  {    char *html, *part, *image_url;    const char *ct;    part = mime_part_address(obj);    if (!part) return MIME_OUT_OF_MEMORY;    image_url = mime_set_url_part(obj->options->url, part, PR_TRUE);    if (!image_url)    {		  PR_Free(part);      return MIME_OUT_OF_MEMORY;    }    PR_Free(part);        ct = obj->content_type;    if (!ct) ct = IMAGE_GIF;  /* Can't happen?  Close enough. */	  // Fill in content type and attachment name here.    nsCAutoString url_with_filename(image_url);    url_with_filename += "&type=";    url_with_filename += ct;    char * filename = MimeHeaders_get_name ( obj->headers, obj->options );    if (filename)    {      char *escapedName = nsEscape(filename, url_Path);      if (!escapedName) return MIME_OUT_OF_MEMORY;      url_with_filename += "&filename=";      url_with_filename += escapedName;      nsCRT::free(escapedName);      PR_Free(filename);    }    // We need to separate images with HR's...    MimeObject_write_separator(obj);	  img->image_data =      obj->options->image_begin(url_with_filename.get(), ct, obj->options->stream_closure);    PR_Free(image_url);    if (!img->image_data) return MIME_OUT_OF_MEMORY;    html = obj->options->make_image_html(img->image_data);    if (!html) return MIME_OUT_OF_MEMORY;    status = MimeObject_write(obj, html, strlen(html), PR_TRUE);    PR_Free(html);    if (status < 0) return status;  }  //   // Now we are going to see if we should set the content type in the  // URI for the url being run...  //  if (obj->options && obj->options->stream_closure && obj->content_type)  {    mime_stream_data  *msd = (mime_stream_data *) (obj->options->stream_closure);    if ( (msd) && (msd->channel) )    {      msd->channel->SetContentType(nsDependentCString(obj->content_type));    }  }  return 0;}