[dovecot-cvs] dovecot/src/imap cmd-append.c,1.31,1.32

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


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

Modified Files:
	cmd-append.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: cmd-append.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- cmd-append.c	16 Oct 2003 15:50:20 -0000	1.31
+++ cmd-append.c	9 Nov 2003 18:26:25 -0000	1.32
@@ -54,6 +54,7 @@
 	struct imap_arg_list *flags_list;
         struct mailbox_custom_flags old_flags;
 	struct mail_full_flags flags;
+	struct istream *input;
 	time_t internal_date;
 	const char *mailbox, *internal_date_str;
 	uoff_t msg_size;
@@ -180,14 +181,16 @@
 		}
 
 		/* save the mail */
-		i_stream_set_read_limit(client->input,
-					client->input->v_offset + msg_size);
+		input = i_stream_create_limit(default_pool, client->input,
+					      client->input->v_offset,
+					      msg_size);
 		if (!box->save_next(ctx, &flags, internal_date,
-				    timezone_offset, client->input)) {
+				    timezone_offset, input)) {
+			i_stream_unref(input);
 			client_send_storage_error(client, storage);
 			break;
 		}
-		i_stream_set_read_limit(client->input, 0);
+		i_stream_unref(input);
 
 		if (client->input->closed)
 			break;



More information about the dovecot-cvs mailing list