Re: Streaming MIME parser

Gaël Roualland <[email protected]>
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
"suresh!" a écrit :
> 
> Hi,
> I tried using libetpan for parsing RFC2822 messages.
> The first thing that stuck me is that
> libetpan loads all the message content into memory
> before parsing. Is there a stream based
> way of parsing the messages given that memory is at a
> premium in my application. Ideally I
> would like to parse the entire message as a stream
> with callbacks informing about the parsed
> contents.

I don't think you can do that in the current implementation since it is
based in having the message being parsed in memory. However, it is using
mmap on temporary files when possible (the so called mmap_strings), so
it is not really using memory. There's a threshold on the size of
strings over which it will use a mmaped temporary file. If you're short
on memory, perhaps you could make sure the threshold is really low ?

I can see the need to be able to parse a stream, however sooner or later
you will probably need the parts you parsed, so having them handy is
usefull anyway... What are you trying to do ?

Gaël.

-- 
Gaël Roualland -+- [email protected]


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.