[dovecot-cvs] dovecot/src/lib-mail istream-header-filter.c, 1.16, 1.17

cras at dovecot.org cras at dovecot.org
Fri Sep 10 14:44:09 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv460/lib-mail

Modified Files:
	istream-header-filter.c 
Log Message:
Seeking was broken if header hadn't been read yet.



Index: istream-header-filter.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/istream-header-filter.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- istream-header-filter.c	23 Aug 2004 19:27:43 -0000	1.16
+++ istream-header-filter.c	10 Sep 2004 11:44:07 -0000	1.17
@@ -235,6 +235,7 @@
 {
 	struct header_filter_istream *mstream =
 		(struct header_filter_istream *)stream;
+	size_t pos;
 
 	stream->istream.v_offset = v_offset;
 	stream->skip = stream->pos = 0;
@@ -245,6 +246,14 @@
 		mstream->hdr_ctx = NULL;
 	}
 
+	while (!mstream->header_read) {
+		if (_read(stream) == -1)
+			break;
+
+		(void)i_stream_get_data(&stream->istream, &pos);
+		i_stream_skip(&stream->istream, pos);
+	}
+
 	if (v_offset < mstream->header_size.virtual_size) {
 		/* seek into headers. we'll have to re-parse them, use
 		   skip_count to set the wanted position */



More information about the dovecot-cvs mailing list