dovecot-1.2: dict: Fixed crashes when dict process dies.
dovecot at dovecot.org
dovecot at dovecot.org
Fri Apr 10 02:08:24 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/5f96ac54de4d
changeset: 8937:5f96ac54de4d
user: Timo Sirainen <tss at iki.fi>
date: Thu Apr 09 19:08:07 2009 -0400
description:
dict: Fixed crashes when dict process dies.
diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
src/master/dict-process.c | 7 +++++--
diffs (43 lines):
diff -r 153c035cf56b -r 5f96ac54de4d src/master/dict-process.c
--- a/src/master/dict-process.c Thu Apr 09 18:49:54 2009 -0400
+++ b/src/master/dict-process.c Thu Apr 09 19:08:07 2009 -0400
@@ -22,6 +22,7 @@ struct dict_listener {
struct io *io;
struct dict_process *processes;
+ unsigned int destroyed:1;
};
struct dict_process {
@@ -121,7 +122,7 @@ static int dict_process_create(struct di
static void dict_listener_unref(struct dict_listener *listener)
{
- if (listener->processes == NULL)
+ if (listener->processes == NULL && listener->destroyed)
i_free(listener);
}
@@ -190,6 +191,8 @@ static struct dict_listener *dict_listen
static void dict_listener_deinit(struct dict_listener *listener)
{
+ listener->destroyed = TRUE;
+
if (listener->io != NULL)
io_remove(&listener->io);
if (close(listener->fd) < 0)
@@ -209,12 +212,12 @@ dict_process_destroyed(struct child_proc
struct dict_process *process = (struct dict_process *)_process;
struct dict_listener *listener = process->listener;
- dict_process_deinit(process);
if (listener->processes == NULL && listener->fd != -1) {
/* last listener died, create new ones */
listener->io = io_add(listener->fd, IO_READ,
dict_listener_input, listener);
}
+ dict_process_deinit(process);
}
void dict_processes_init(void)
More information about the dovecot-cvs
mailing list