[dovecot-cvs] dovecot/src/lib ostream-file.c,1.12,1.13

cras at procontrol.fi cras at procontrol.fi
Fri Feb 21 16:25:35 EET 2003


Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv25930/lib

Modified Files:
	ostream-file.c 
Log Message:
if connection was closed while trying to write data to client, we sometimes
crashed. also errno wasn't saved.



Index: ostream-file.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ostream-file.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ostream-file.c	19 Feb 2003 23:35:09 -0000	1.12
+++ ostream-file.c	21 Feb 2003 14:25:33 -0000	1.13
@@ -214,6 +214,7 @@
 	if (ret < 0) {
 		if (errno == EAGAIN || errno == EINTR)
 			return 0;
+		fstream->ostream.ostream.stream_errno = errno;
 		stream_closed(fstream);
 		return -1;
 	}
@@ -431,8 +432,10 @@
 	if (iov_len == 0 || o_stream_writev(fstream, iov, iov_len) < 0 ||
 	    iov[iov_len-1].iov_len == 0) {
 		/* error / all sent */
-		io_remove(fstream->io);
-                fstream->io = NULL;
+		if (fstream->io != NULL) {
+			io_remove(fstream->io);
+			fstream->io = NULL;
+		}
 	}
 }
 




More information about the dovecot-cvs mailing list