[dovecot-cvs] dovecot/src/lib ioloop-kqueue.c,1.10,1.11

cras at dovecot.org cras at dovecot.org
Thu Aug 17 21:53:01 EEST 2006


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

Modified Files:
	ioloop-kqueue.c 
Log Message:
Reference IOs before calling timeout handlers, in case they call
io_remove().



Index: ioloop-kqueue.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-kqueue.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- ioloop-kqueue.c	17 Aug 2006 18:46:42 -0000	1.10
+++ ioloop-kqueue.c	17 Aug 2006 18:52:58 -0000	1.11
@@ -122,18 +122,15 @@
 	if (ret < 0 && errno != EINTR)
 		i_fatal("kevent(): %m");
 
-	/* execute timeout handlers */
-	io_loop_handle_timeouts(ioloop);
-
-	if (!ioloop->running)
-		return;
-
 	/* reference all IOs */
 	for (i = 0; i < ret; i++) {
 		io = events[i].udata;
 		io->refcount++;
 	}
 
+	/* execute timeout handlers */
+	io_loop_handle_timeouts(ioloop);
+
 	for (i = 0; i < ret; i++) {
 		/* io_loop_handle_add() may cause events array reallocation,
 		   so we have use array_idx() */



More information about the dovecot-cvs mailing list