[dovecot-cvs] dovecot/src/lib-index mail-index-update.c,1.49,1.50

cras at procontrol.fi cras at procontrol.fi
Wed Mar 26 19:29:04 EET 2003


Update of /home/cvs/dovecot/src/lib-index
In directory danu:/tmp/cvs-serv10853/lib-index

Modified Files:
	mail-index-update.c 
Log Message:
Better handling for multiline headers. Before we skipped headers larger than
input buffer size (8k with read (default), 256k with mmap). The skipping was
also a bit buggy.

Now we parse the lines one at a time. There's also a way to read the header
fully into memory before parsing it, if really needed.



Index: mail-index-update.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-update.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- mail-index-update.c	26 Mar 2003 15:40:16 -0000	1.49
+++ mail-index-update.c	26 Mar 2003 17:29:02 -0000	1.50
@@ -2,6 +2,7 @@
 
 #include "lib.h"
 #include "buffer.h"
+#include "str.h"
 #include "istream.h"
 #include "ioloop.h"
 #include "str.h"
@@ -384,9 +385,7 @@
 };
 
 static void update_header_cb(struct message_part *part,
-			     const unsigned char *name, size_t name_len,
-			     const unsigned char *value, size_t value_len,
-			     void *context)
+			     struct message_header_line *hdr, void *context)
 {
 	struct header_update_context *ctx = context;
 
@@ -399,14 +398,12 @@
 			ctx->envelope_pool =
 				pool_alloconly_create("index envelope", 2048);
 		}
-		imap_envelope_parse_header(ctx->envelope_pool, &ctx->envelope,
-					   name, name_len, value, value_len);
+		imap_envelope_parse_header(ctx->envelope_pool,
+					   &ctx->envelope, hdr);
 	}
 
-	if (ctx->header_cb != NULL) {
-		ctx->header_cb(part, name, name_len,
-			       value, value_len, ctx->context);
-	}
+	if (ctx->header_cb != NULL)
+		ctx->header_cb(part, hdr, ctx->context);
 }
 
 void mail_index_update_headers(struct mail_index_update *update,




More information about the dovecot-cvs mailing list