[dovecot-cvs] dovecot/src/lib-mail message-body-search.c,1.14,1.15

cras at procontrol.fi cras at procontrol.fi
Sun Nov 9 20:26:27 EET 2003


Update of /home/cvs/dovecot/src/lib-mail
In directory danu:/tmp/cvs-serv3937/lib-mail

Modified Files:
	message-body-search.c 
Log Message:
istream rewrite. instead of directly setting any limits to stream, you now
have to use i_stream_create_limit() to existing stream. this should make the
istreams much easier to create and understand how they work.



Index: message-body-search.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-mail/message-body-search.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- message-body-search.c	21 Sep 2003 16:21:37 -0000	1.14
+++ message-body-search.c	9 Nov 2003 18:26:25 -0000	1.15
@@ -275,7 +275,6 @@
 	buffer_t *decodebuf;
 	pool_t pool;
 	size_t data_size, pos;
-	uoff_t old_limit;
 	ssize_t ret;
 	int found;
 
@@ -302,9 +301,8 @@
 	i_stream_skip(input, part->physical_pos +
 		      part->header_size.physical_size - input->v_offset);
 
-	old_limit = input->v_limit;
-	i_stream_set_read_limit(input, input->v_offset +
-				part->body_size.physical_size);
+	input = i_stream_create_limit(default_pool, input, 0,
+				      part->body_size.physical_size);
 
 	found = FALSE; pos = 0;
 	while (i_stream_read_data(input, &data, &data_size, pos) > 0) {
@@ -347,7 +345,7 @@
 		pos -= data_size;
 	}
 
-	i_stream_set_read_limit(input, old_limit);
+	i_stream_unref(input);
 
 	if (ctx->translation != NULL)
 		charset_to_utf8_end(ctx->translation);



More information about the dovecot-cvs mailing list