dovecot-2.0: lib-master: Fixes to handling FIFO connections. Als...

dovecot at dovecot.org dovecot at dovecot.org
Fri Sep 4 20:48:06 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/5b36fa967538
changeset: 9864:5b36fa967538
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Sep 04 13:45:33 2009 -0400
description:
lib-master: Fixes to handling FIFO connections. Also expose the FIFOness to caller.

diffstat:

2 files changed, 8 insertions(+), 8 deletions(-)
src/lib-master/master-service.c |   13 ++++++-------
src/lib-master/master-service.h |    3 ++-

diffs (44 lines):

diff -r 3e20e23154e0 -r 5b36fa967538 src/lib-master/master-service.c
--- a/src/lib-master/master-service.c	Fri Sep 04 12:38:00 2009 -0400
+++ b/src/lib-master/master-service.c	Fri Sep 04 13:45:33 2009 -0400
@@ -499,13 +499,12 @@ static void master_service_listen(struct
 		}
 		/* it's not a socket. probably a fifo. use the "listener"
 		   as the connection fd and stop the listener. */
+		conn.fd = l->fd;
+		conn.listen_fd = l->fd;
+		conn.fifo = TRUE;
+
 		io_remove(&l->io);
-		conn.fd = dup(l->fd);
-		conn.listen_fd = l->fd;
-		if (conn.fd == -1) {
-			i_error("dup() failed: %m");
-			return;
-		}
+		l->fd = -1;
 	}
 	conn.ssl = l->ssl;
 	net_set_nonblock(conn.fd, TRUE);
@@ -547,7 +546,7 @@ static void io_listeners_add(struct mast
 	for (i = 0; i < service->socket_count; i++) {
 		struct master_service_listener *l = &service->listeners[i];
 
-		if (l->io == NULL) {
+		if (l->io == NULL && l->fd != -1) {
 			l->io = io_add(MASTER_LISTEN_FD_FIRST + i, IO_READ,
 				       master_service_listen, l);
 		}
diff -r 3e20e23154e0 -r 5b36fa967538 src/lib-master/master-service.h
--- a/src/lib-master/master-service.h	Fri Sep 04 12:38:00 2009 -0400
+++ b/src/lib-master/master-service.h	Fri Sep 04 13:45:33 2009 -0400
@@ -23,7 +23,8 @@ struct master_service_connection {
 	struct ip_addr remote_ip;
 	unsigned int remote_port;
 
-	bool ssl;
+	unsigned int fifo:1;
+	unsigned int ssl:1;
 };
 
 typedef void


More information about the dovecot-cvs mailing list