Justin Erenkrantz wrote:
@@ -782,14 +731,31 @@

    mbox_fillbuf(&b);

+ msgID = NULL;
apr_pool_create(&tpool, r->pool);
/* When we reach the end of the file, b is NULL. */
while (b.b)
{
+#ifdef APR_HAS_MMAP
+ msgc.body_end = b.b - b.sb;
+#else
+ msgc.body_end = b.totalread - b.len + b.b - b.rb;
+#endif if (b.b[0] == 'F' && b.b[1] == 'r' && b.b[2] == 'o' && b.b[3] == 'm' &&
b.b[4] == ' ')
{
+ if (msgID) {
+ store_msgc(tpool, msgDB, msgID, &msgc, indexer, list, domain);
+ msgID = NULL;
+ }
+ apr_pool_clear(tpool);


This is a very odd bit of code and use of pools.  If I read it correctly, you
are delaying updating the index until you read the beginning of the next
message.  If that is the case, then a comment explaining that would go a
long way to making it clear.


I added a comment that tries to explain some of it. More or less, it is doing this to find the body_end.

Reply via email to