Closed Bug 478176 Opened 16 years ago Closed 16 years ago

multipart/signed does not generate JS emitter events for its immediate payload child

Categories

(MailNews Core :: MIME, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b2

People

(Reporter: asuth, Assigned: asuth)

References

Details

Attachments

(1 file)

Because multipart/signed (MimeMultipartSigned) defers processing of its payload child, the super-class antics of multipart/* (MimeMultipart) never generate the events that the JS emitter (added in bug 447842) is expecting. However, when the payload child is eventually processed, if it has any children, the JS emitter event chain does happen. Example. Actual MIME structure: 1 multipart/mixed 1.1 multipart/signed 1.1.1 multipart/alternative 1.1.1.1 text/plain 1.1.1.2 text/html 1.1.2 application/x-pkcs7-signature 1.2 text/plain MIME structure perceived by JS emitter 1 multipart/mixed 1.1 multipart/signed g-g-ghost! 1.1.1.1 text/plain 1.1.1.2 text/html (signature also not seen, but no one cares) 1.2 text/plain The JS emitter is afraid of ghosts and freaks out when it hears about the text/plain. The provided patch causes the expected series of events to be generated for 1.1.1. (Note, this blocks 465113, which is itself a blocker.)
Flags: blocking-thunderbird3?
Attachment #361953 - Flags: superreview?(bienvenu)
Attachment #361953 - Flags: review?(bienvenu)
Attachment #361953 - Flags: superreview?(bienvenu)
Attachment #361953 - Flags: superreview+
Attachment #361953 - Flags: review?(bienvenu)
Attachment #361953 - Flags: review+
Comment on attachment 361953 [details] [diff] [review] v1 emit jsemitter events for the payload child of multipart/signed parts I've managed to get this code to trigger from gloda, and nothing bad seems to happen. If you wanted to, you could tighten this up a little - + if (ct) { + mimeEmitterAddHeaderField(obj->options, HEADER_CONTENT_TYPE, ct); + PR_Free(ct); + } + else { + // no content type means text/plain + mimeEmitterAddHeaderField(obj->options, HEADER_CONTENT_TYPE, + "text/plain"); + } could simply be: + mimeEmitterAddHeaderField(obj->options, HEADER_CONTENT_TYPE, ct ? ct : "text/plain"); + PR_Free(ct); because PR_Free(null) is harmless.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: blocking-thunderbird3?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: