[dovecot-cvs] dovecot/src/lib ostream-file.c,1.50,1.51

cras at dovecot.org cras at dovecot.org
Sun May 29 13:50:09 EEST 2005


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

Modified Files:
	ostream-file.c 
Log Message:
Set output I/O handler after output callback if needed.



Index: ostream-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ostream-file.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- ostream-file.c	28 May 2005 11:31:19 -0000	1.50
+++ ostream-file.c	29 May 2005 10:50:06 -0000	1.51
@@ -364,11 +364,17 @@
 	if (ret == 0)
 		fstream->flush_pending = TRUE;
 
-	if (!fstream->flush_pending &&
-	    IS_STREAM_EMPTY(fstream) && fstream->io != NULL) {
-		/* all sent */
-		io_remove(fstream->io);
-		fstream->io = NULL;
+	if (!fstream->flush_pending && IS_STREAM_EMPTY(fstream)) {
+		if (fstream->io != NULL) {
+			/* all sent */
+			io_remove(fstream->io);
+			fstream->io = NULL;
+		}
+	} else {
+		if (fstream->io == NULL) {
+			fstream->io = io_add(fstream->fd, IO_WRITE,
+					     stream_send_io, fstream);
+		}
 	}
 
 	o_stream_unref(&fstream->ostream.ostream);



More information about the dovecot-cvs mailing list