[dovecot-cvs] dovecot/src/lib-storage/index index-mail.c,1.86,1.87

cras at dovecot.org cras at dovecot.org
Mon Aug 15 13:56:50 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv11702/index

Modified Files:
	index-mail.c 
Log Message:
If mail_get_stream() is called when stream had already been used and seeked
to non-start, it calculated the header/body sizes wrong.



Index: index-mail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- index-mail.c	23 Jul 2005 07:52:06 -0000	1.86
+++ index-mail.c	15 Aug 2005 10:56:48 -0000	1.87
@@ -450,7 +450,8 @@
 	if (hdr_size != NULL || body_size != NULL)
 		(void)get_cached_msgpart_sizes(mail);
 
-	if (hdr_size != NULL) {
+	if (hdr_size != NULL || body_size != NULL) {
+		i_stream_seek(data->stream, 0);
 		if (!data->hdr_size_set) {
 			if ((data->access_part & PARSE_HDR) != 0) {
 				if (index_mail_parse_headers(mail, NULL) < 0)
@@ -466,6 +467,7 @@
 	}
 
 	if (body_size != NULL) {
+		i_stream_seek(data->stream, data->hdr_size.physical_size);
 		if (!data->body_size_set) {
 			if ((data->access_part & PARSE_BODY) != 0)
 				index_mail_parse_body(mail, FALSE);



More information about the dovecot-cvs mailing list