[dovecot-cvs] dovecot/src/lib istream-file.c, 1.30, 1.31 istream-internal.h, 1.12, 1.13 istream.c, 1.37, 1.38

tss at dovecot.org tss at dovecot.org
Sat Mar 31 11:37:57 EEST 2007


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

Modified Files:
	istream-file.c istream-internal.h istream.c 
Log Message:
Moved i_stream_compress() to generic code



Index: istream-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/istream-file.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- istream-file.c	31 Mar 2007 08:32:32 -0000	1.30
+++ istream-file.c	31 Mar 2007 08:37:54 -0000	1.31
@@ -41,15 +41,6 @@
 	p_free(_stream->iostream.pool, _stream->w_buffer);
 }
 
-static void i_stream_compress(struct _istream *stream)
-{
-	memmove(stream->w_buffer, stream->w_buffer + stream->skip,
-		stream->pos - stream->skip);
-	stream->pos -= stream->skip;
-
-	stream->skip = 0;
-}
-
 static ssize_t _read(struct _istream *stream)
 {
 	struct file_istream *fstream = (struct file_istream *) stream;
@@ -64,7 +55,7 @@
 	if (stream->pos == stream->buffer_size) {
 		if (stream->skip > 0) {
 			/* remove the unused bytes from beginning of buffer */
-                        i_stream_compress(stream);
+                        _i_stream_compress(stream);
 		} else if (stream->max_buffer_size == 0 ||
 			   stream->buffer_size < stream->max_buffer_size) {
 			/* buffer is full - grow it */

Index: istream-internal.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/istream-internal.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- istream-internal.h	31 Mar 2007 08:32:32 -0000	1.12
+++ istream-internal.h	31 Mar 2007 08:37:54 -0000	1.13
@@ -33,6 +33,7 @@
 struct istream *_i_stream_create(struct _istream *_buf, pool_t pool, int fd,
 				 uoff_t abs_start_offset);
 
+void _i_stream_compress(struct _istream *stream);
 void _i_stream_grow_buffer(struct _istream *stream, size_t bytes);
 
 #endif

Index: istream.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/istream.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- istream.c	31 Mar 2007 08:32:32 -0000	1.37
+++ istream.c	31 Mar 2007 08:37:54 -0000	1.38
@@ -265,6 +265,15 @@
 	return -1;
 }
 
+void _i_stream_compress(struct _istream *stream)
+{
+	memmove(stream->w_buffer, stream->w_buffer + stream->skip,
+		stream->pos - stream->skip);
+	stream->pos -= stream->skip;
+
+	stream->skip = 0;
+}
+
 void _i_stream_grow_buffer(struct _istream *stream, size_t bytes)
 {
 	size_t old_size;



More information about the dovecot-cvs mailing list