[dovecot-cvs] dovecot/src/plugins/zlib istream-zlib.c,1.4,1.5

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


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

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



Index: istream-zlib.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/zlib/istream-zlib.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- istream-zlib.c	31 Mar 2007 08:33:37 -0000	1.4
+++ istream-zlib.c	31 Mar 2007 08:37:54 -0000	1.5
@@ -40,15 +40,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 zlib_istream *zstream = (struct zlib_istream *)stream;
@@ -64,7 +55,7 @@
 		if (!zstream->marked && stream->skip > 0) {
 			/* don't try to keep anything cached if we don't
 			   have a seek mark. */
-			i_stream_compress(stream);
+			_i_stream_compress(stream);
 		}
 
 		if (stream->max_buffer_size == 0 ||
@@ -76,7 +67,7 @@
 		if (stream->pos == stream->buffer_size) {
 			if (stream->skip > 0) {
 				/* lose our buffer cache */
-				i_stream_compress(stream);
+				_i_stream_compress(stream);
 			}
 
 			if (stream->pos == stream->buffer_size)
@@ -165,7 +156,7 @@
 	}
 
 	if (mark) {
-		i_stream_compress(stream);
+		_i_stream_compress(stream);
 		zstream->marked = TRUE;
 	}
 }



More information about the dovecot-cvs mailing list