james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Bagnara <apa...@bago.org>
Subject Re: parsing large fields with Mime4j
Date Tue, 12 Jan 2010 20:06:15 GMT
2010/1/12 Rohan Hart <rohan.hart17@gmail.com>:
> Hi
>
> As may be gleaned from the 4 enhancements I've just raised (163-166)
> I'm interested in being able to parse more from excessively large
> fields and ignore more from fields which I don't need to look at.

Currently the addresslist parser takes a buffer in input and the whole
addresslist must be placed in a single buffer.

The stream parser currently takes header lines and returns an event
for each line. Parsing can be delayed, but a single buffer for each
header is built.

In order to change this each field body should be treated in a similar
way to mime contents and a way to access the field stream would be
needed. So, if I understand your request, you would change the parser
to only check for the header name until it finds the ":" then throw an
event "HEADER_FIELD" passing you the name and a stream including all
the folded lines and terminating with the last folded line. At this
point you would wrap the stream in a reader and use the
AddressFieldParser to parse the stream (I don't remember if the
AddressFieldParser will parse the whole stream at once and return the
parsed structure or if you can traverse the tree without storing it in
memory).

> Judging from the number of tasks assigned to 0.7 I assume that it's
> due out "real soon".  Any idea on the time frame for that or 0.8?

We didn't decide this yet.

What you see fixed for 0.7 is currently in trunk, then I started a
refactoring in the "cycleclean" branch and it is under review right
now. I don't know, currently, if the cycleclean branch will survive
and included in 0.7, or merged for 0.8 or die.

Currently I don't know if you should better develop your change
against trunk or the cycleclean branch (maybe you can help looking at
both and saying your opinion about their organization).

Stefano

Mime
View raw message