[dovecot-cvs] dovecot/src/lib istream-seekable.c,1.2,1.3

cras at dovecot.org cras at dovecot.org
Sat Apr 23 22:41:42 EEST 2005


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

Modified Files:
	istream-seekable.c 
Log Message:
Allow non-first streams also to have pending data.



Index: istream-seekable.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/istream-seekable.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- istream-seekable.c	23 Apr 2005 19:35:05 -0000	1.2
+++ istream-seekable.c	23 Apr 2005 19:41:40 -0000	1.3
@@ -131,6 +131,7 @@
 
 static ssize_t read_more(struct seekable_istream *sstream)
 {
+	size_t size;
 	ssize_t ret;
 
 	if (sstream->cur_input == NULL) {
@@ -153,6 +154,11 @@
 			sstream->istream.istream.eof = TRUE;
 			return -1;
 		}
+
+		/* see if stream has pending data */
+		(void)i_stream_get_data(sstream->cur_input, &size);
+		if (size != 0)
+			return size;
 	}
 	return ret;
 }



More information about the dovecot-cvs mailing list