зеркало из https://github.com/mozilla/gecko-dev.git
Remaining fix for bug 83263. Don't stop parsing alternative parts at the first invalid one, instead continue until the last one. R=varada, SR=mscott, A=asa
This commit is contained in:
Родитель
75c2a47ecf
Коммит
cd488b8463
|
@ -165,11 +165,10 @@ MimeMultipartAlternative_create_child(MimeObject *obj)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* If this part is not displayable, then we're done -- all that is left
|
||||
to do is to flush out the part that is currently in the cache.
|
||||
/* If this part is not displayable, then skip it. maybe the next one will be...
|
||||
*/
|
||||
mult->state = MimeMultipartEpilogue;
|
||||
return MimeMultipartAlternative_display_cached_part(obj);
|
||||
mult->state = MimeMultipartSkipPartLine;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ MimeMultipart_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
|||
// If "multipart/alternative" or the first part is a message body
|
||||
// then we should check for a charset and notify the emitter
|
||||
// if one exists.
|
||||
if (obj->options && (isAlternative || isBody))
|
||||
if (obj->options && ((isAlternative && mult->state != MimeMultipartSkipPartLine) || isBody))
|
||||
{
|
||||
{
|
||||
char *ct = MimeHeaders_get(mult->hdrs, HEADER_CONTENT_TYPE, PR_FALSE, PR_FALSE);
|
||||
|
@ -314,6 +314,10 @@ MimeMultipart_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
|||
if (status < 0) return status;
|
||||
break;
|
||||
|
||||
case MimeMultipartSkipPartLine:
|
||||
/* we are skipping that part, therefore just ignore the line */
|
||||
break;
|
||||
|
||||
default:
|
||||
PR_ASSERT(0);
|
||||
return -1;
|
||||
|
|
|
@ -93,6 +93,7 @@ typedef enum {
|
|||
MimeMultipartHeaders,
|
||||
MimeMultipartPartFirstLine,
|
||||
MimeMultipartPartLine,
|
||||
MimeMultipartSkipPartLine,
|
||||
MimeMultipartEpilogue
|
||||
} MimeMultipartParseState;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче