Closed
Bug 81751
Opened 24 years ago
Closed 24 years ago
when attaching multipart web pages to a piece of email only final part should be attached
Categories
(MailNews Core :: Composition, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: blizzard, Assigned: bugzilla)
Details
(Whiteboard: [nsbeta1+])
Attachments
(3 files)
|
21.50 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.62 KB,
patch
|
Details | Diff | Splinter Review | |
|
20.84 KB,
patch
|
Details | Diff | Splinter Review |
When you attach a multipart web page to an email message it's attached as the
entire multipart message instead of just the final part. A good way to
reproduce this is to attach a bugzilla query. Instead of the resulting html
that is the bug list it attaches the entire query. This isn't what 4.x does.
This is a spinoff of bug 81682.
| Reporter | ||
Updated•24 years ago
|
Whiteboard: want for mozilla 0.9.1
| Assignee | ||
Comment 1•24 years ago
|
||
yes, 4.x correctly attach the last part of the CGI response.
Status: NEW → ASSIGNED
| Reporter | ||
Comment 2•24 years ago
|
||
What are the odds of seeing this in 0.9.1? It's been bugging the hell out of me
for a while now.
| Assignee | ||
Comment 3•24 years ago
|
||
where can I find specs about http multiparts? What the rules? I presume should be like mime! Does the separator is
always the same?
| Assignee | ||
Comment 4•24 years ago
|
||
When I fetch a URL, I receive a content type, so far we are doing nothing with it. For regular web page, the content
type is text/html but in case of a bugzilla query, it's multipart/x-mixed-replace. I searched 4.x code and looks like I
will need to add a converter to support the following content-type:
multipart/x-mixed-replace
multipart/x-byteranges
multipart/byteranges
multipart/mixed
| Assignee | ||
Comment 5•24 years ago
|
||
good news, netwerk already provider all those converters. All I need to do, is to refuse to handle those content-type
in nsIURLFetcher and then figure out which part I need to save. Should be not too complex for multipart/x-mixed-
replace but I don't have a clue about the meaning of the other one and especially how to test them.
| Assignee | ||
Comment 6•24 years ago
|
||
I have a fix (for multipart/x-mixed-replace) that I need to cleanup a littele bit before I can post the diff.
Nominating nsbeta1.
Keywords: nsbeta1
| Assignee | ||
Comment 7•24 years ago
|
||
| Assignee | ||
Updated•24 years ago
|
Whiteboard: want for mozilla 0.9.1 → want for mozilla 0.9.1, Have fix
| Reporter | ||
Comment 8•24 years ago
|
||
+#define MULTIPART_MIXED_REPLACE "multipart/x-mixed-replace"
+#define MULTIPART_MIXED "multipart/mixed"
+#define MULTIPART_BYTERANGES "multipart/byteranges"
Aren't there defines for these elsewhere? kMimeMultiPart or something? If not
shouldn't there be?
+ if (nsCRT::strcasecmp(aContentType, UNKNOWN_CONTENT_TYPE) == 0)
+ rv = InsertConverter(aContentType);
+ else
+ /*
+ if the content type is multipart/x-mixed-replace, we need to insert the
+ multipart converter.
+ */
+ if (nsCRT::strcasecmp(aContentType, MULTIPART_MIXED_REPLACE) == 0)
+ rv = InsertConverter(aContentType);
+ else
Can you move the else closer to the if please? It's confusing when there's a
comment in the middle when looking at the code.
+ /* In case of multipart/x-mixed-replace, we need to truncate the file to
the current part size */
+ if (PL_strcasecmp(mConverterContentType, MULTIPART_MIXED_REPLACE) == 0)
{
- mContentType = contentType;
+ PRInt64 fileSize;
+ LL_I2L(fileSize, mTotalWritten);
+ mLocalFile->SetFileSize(fileSize);
Does this truncate before the final write? I'm wondering if you're truncating
with the final file size using the trailing marker in the multi part message or not.
| Assignee | ||
Comment 9•24 years ago
|
||
>Aren't there defines for these elsewhere? kMimeMultiPart or something? If not
>shouldn't there be?
No, they are not defined yet (except mixed/multipart) but I can add then to the mime type file and fix the few place
in the Mozilla code where the hardcoded string is used.
>Can you move the else closer to the if please? It's confusing when there's a
>comment in the middle when looking at the code.
Sure, I'll...
>Does this truncate before the final write? I'm wondering if you're truncating
>with the final file size using the trailing marker in the multi part message or not.
This append when we are done writing the final part and we have already close the file.
I'll post soon a news patch that take care of those comments...
Comment 10•24 years ago
|
||
Putting in 0.9.1. It looks like this will prevent the crash in 81682 and it
makes so you can actually read the page that was sent in the message.
Priority: -- → P2
Whiteboard: want for mozilla 0.9.1, Have fix → [nsbeta1+]want for mozilla 0.9.1, Have fix
Target Milestone: --- → mozilla0.9.1
| Reporter | ||
Comment 11•24 years ago
|
||
It will only prevent the crash because people might not send out messages with
it. Wallpaper.
| Assignee | ||
Comment 12•24 years ago
|
||
| Assignee | ||
Comment 13•24 years ago
|
||
Comment 14•24 years ago
|
||
If the crash gets fixed (which it sounds like it will), what's the worst thing
that will happen by keeping this bug open until 0.9.2? My understanding is that
in the 0.9.1 build the user should be able to open the attachment to see the
message. Is that not correct?
| Assignee | ||
Comment 15•24 years ago
|
||
I don't know if we will be able to display correctly the page if we fixe just
the crash.
This bug affect dynamically generated page that use multipart, that should not
be too much.
Comment 16•24 years ago
|
||
I think we can wait until 0.9.2 for this and then get more time to play with
this change at the beginning of a milestone.
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Comment 17•24 years ago
|
||
Putting back on 0.9.1 radar. It looks like it's going to be hard to fix the crash.
Target Milestone: mozilla0.9.2 → mozilla0.9.1
Updated•24 years ago
|
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Have fix → [nsbeta1+]want for mozilla 0.9.1, Have fix, need r=,sr=
Comment 18•24 years ago
|
||
r=varada
| Assignee | ||
Comment 19•24 years ago
|
||
The patch add support for multipart/x-mixed-replace and has been tested for it.
But I have also added support for other type of multipart (mixed, byteranges)
for which I don't have a test case and therefore cannot quaranty at 100% I am
doing the right thing (that doesn't means it will crash but that maybe I am not
generating the rigth output).
| Assignee | ||
Updated•24 years ago
|
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Have fix, need r=,sr= → [nsbeta1+]want for mozilla 0.9.1, Have fix, have r=, need sr=
Comment 20•24 years ago
|
||
hmmm this is a pretty hefty change in the way we do things for generating
certain attachments. The code looks okay to me but we're going to have to test
the heck out of this stuff once you check it in. I bet dougt may be able to help
you find a website that uses multi-part/byte. I vaguely remember him checking in
a fix to the multi-part converter recently to make it work with multi-part/byte
pages. that would at least give us a test case for the byte part.
sr=mscott
| Assignee | ||
Updated•24 years ago
|
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Have fix, have r=, need sr= → [nsbeta1+]want for mozilla 0.9.1, Have fix, have r= and sr=, need a=
Comment 21•24 years ago
|
||
Scott, are you concerned about attachment types besides x-mixed-replace and
byteranges like all attachments in general?
If you think there's a lot of testing needed perhaps we should have a bunch of
people run with this for a few days or just wait until 0.9.2. I'm not sure how
many pages there are out there like this but my guess is that it's not high
enough to risk attachment sending. If I misinterpreted your concerns, let me know.
dougt, do you have any examples of sites with multipart/byteranges?
Comment 22•24 years ago
|
||
the only example that I have of multipart byterange is via plugins. If you go
to www.adobe.com, and view a pdf from there (or any http server that supports
range requests), the plugin will request ranges from the http server. This
content comes back from the server as multipart/byterange.
Also, you can hack TestProtocols. Add a header that has two or more segmented
ranges.
Does this help?
Comment 23•24 years ago
|
||
a= asa@mozilla.org (on behalf of drivers)
| Assignee | ||
Updated•24 years ago
|
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Have fix, have r= and sr=, need a= → [nsbeta1+]want for mozilla 0.9.1, Ready to be checked in
Comment 24•24 years ago
|
||
I know this got the approval, but I'd like to ask if this can get into 0.9.2
instead (I know I'm flipping back and forth). I think it would be good to have
some more time to run with this.
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Comment 25•24 years ago
|
||
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
| Assignee | ||
Comment 26•24 years ago
|
||
Fixed and checked in (TRUNK ONLY)
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Ready to be checked in → [nsbeta1+]
Comment 27•24 years ago
|
||
Using builds for win, mac and linux dated 06-27-01 and the original scenario,
this is fixed. Verified. Note: we do not have tests for
miltipart/x-mixed-replace & multipart/byteranges. Verified based on original
scenario.
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: MailNews → Core
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•