[dovecot-cvs] dovecot/src/lib ostream-file.c,1.24,1.25

cras at procontrol.fi cras at procontrol.fi
Sun May 23 04:58:26 EEST 2004


Update of /home/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv9090

Modified Files:
	ostream-file.c 
Log Message:
o_stream_send_istream() fix



Index: ostream-file.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ostream-file.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- a/ostream-file.c	9 Nov 2003 18:26:25 -0000	1.24
+++ b/ostream-file.c	23 May 2004 01:58:24 -0000	1.25
@@ -701,7 +701,8 @@
 
 			(void)i_stream_read_data(instream, &data, &size,
 						 read_size-1);
-			if (size == read_size) {
+			if (size >= read_size) {
+				size = read_size;
 				if (instream->mmaped) {
 					/* we'll have to write it through
 					   buffer of the file gets corrupted */
@@ -713,15 +714,11 @@
 				break;
 			}
 
-			i_assert(size < read_size);
-			if (size < read_size) {
-				/* buffer too large probably,
-				   try with smaller */
-				read_size -= size;
-				in_offset += read_size;
-				out_offset += read_size;
-				buffer_size -= read_size;
-			}
+			/* buffer too large probably, try with smaller */
+			read_size -= size;
+			in_offset += read_size;
+			out_offset += read_size;
+			buffer_size -= read_size;
 		}
 		in_limit -= size;
 



More information about the dovecot-cvs mailing list