Em Quinta 04 Dezembro 2003 07:49, Magnus Sundberg escreveu:
> One silly question,
> How do we know which headers to cache?
> The headers are stored in the first messageblock in for the message.
> Suppose we stored the headers in a separate table and used the
> database indexing facilities.
> We could then do without a separate header cache, by just using
> well formulated queries.


I actually like all the headers at the first block. I think it's a simplified 
solution. My problem is only when dealing with mime headers, that are inside 
de message. 
A "post-processing" approach for this would first map the messageblks used by 
the message, then search for the "boundary" word (we could have false 
positives). Then we would read at the selected messageblocks, interpret the 
mime header start and end, and use the information. I did something like 
that, but I think it is too cpu intensive if I don't save this info into a 
table for caching.

A better solution:
Caching the mime headers when the message enters would not be so complicated. 
All you have to do is to wait do a sequence with the structure 
"\n--*boundary*" (where * means any number of ascii characters, not space)
This is the start of the mime header, and we all know where it is. ;-)
of course that the sentence imediately after the boundary is the reference key 
for the mime tree structure, but this can be done later, with no cpu 
compromise.
You can do even a mime parent reference field, that tells what is the mime 
parent with checking every boundary entered with a boundary history list.

Anyone interested in doing this, or I will have to remember how to program in 
C? ;-)
(I've programmed in C for ten years, but this is 5 years ago, it's only java 
since then...8-P) 

[]s, gandhi

-- 
Ricardo Andere de Mello
Quilombo Digital - Presidente
[EMAIL PROTECTED] - 55 11 32717928

Reply via email to