[dovecot-cvs] dovecot/src/lib ioloop-kqueue.c,1.4.2.6,1.4.2.7

cras at dovecot.org cras at dovecot.org
Thu Aug 17 21:52:59 EEST 2006


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

Modified Files:
      Tag: branch_1_0
	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.4.2.6
retrieving revision 1.4.2.7
diff -u -d -r1.4.2.6 -r1.4.2.7
--- ioloop-kqueue.c	17 Aug 2006 18:46:41 -0000	1.4.2.6
+++ ioloop-kqueue.c	17 Aug 2006 18:52:57 -0000	1.4.2.7
@@ -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